Thank you both!
Tiaan,
I chose a repeater since I couldn’t figure out a way to link a gallery to multiple database fields (image1, image2, image3)… I know next to nothing about Javascript, as you can tell
I just attempted to use your suggested code on a gallery, and it does indeed adjust to the number of images available for the current database item, but is not able to retrieve any pictures. Just shows grey boxes and a ‘processing’ symbol.
strcroppe,
Your code works really well on the repeater, although the icons appear for a second while waiting for the repeater to populate (because of ‘onItemReady’, right - can’t change that to ‘onPageReady’, can you?). I didn’t know ‘length’ existed or was applicable to names - thought you needed to use some kind of boolean value. Makes sense!