Detecting mesh and/or material by texture name from gltf

My project recently moved from threejs 115 too 128. We load a gltf file that contains one node. The node contains two meshes (A and B), each uses one of two materials (A and B) respectively, which each reference one of two textures (A and B), respectively. Our code needs to apply a shader to one of the two materials – A. However, sometimes the order of the materials (and thus meshes and textures) is reversed (B, A instead of A, B). In threejs 115, we relied on the name of the texture image URL (e.g. “B.jpg”) to reliably determine which was which. However, we are not able to find any equivalent properties available in 128. It seems that the image is loaded and then only exists as binary data in the texture, with no reference to the filename or texture name or url anymore, at least in the json we exported to check. The object has an array of children which appear to be named Filename_0 and Filename_1 if the gltf is Filename.gltf, but these are not names we assigned anywhere inside the gltf. It seems like our best option is to re-order the meshes (or materials) in Blender before we export the gltf, or possibly to add user data to the object before export. But I wanted to make sure I am not missing anything in the change from 115 to 128.