Collection instances with different textures

hi
I needed to change the texture of several objects, instances of a collection, and I made this material.
Basically it uses a unique texture that contains all the textures to use (image sprite), and chooses the one to show by taking the value of the custom property “prop” and uses it in the node “Attribute”.
So an instance with the property set to 4 will take the fourth sprite, counting from right to left, top to bottom; the object with the material must have the UV map.
In the material you have to set the values for the number of sprite horizontally and vertically (the value with label nSpriteX and nSpriteY, on the left in the screenshot).

Uploading: linkedDifferentTextures.blend…

It also works for linked collections from other .blend file.
Maybe it can be useful to someone.
Ciao!