I need to do this in code so i can connect more images in a database to an image gallery. If anyone knows how to code it, that would be of great help.
Query the collection
Pull all the image fields from the query results
Build a GalleryItem object for each image
Set the gallery's items property to an array of the GalleryItems