Wix Pro Gallery - Not loading, resizing, and cropping photos

I have a Wix Pro Grid Gallery set to crop, 4:3 ratio, and horizontal scroll. I periodically run an API call that gets data including photos. I store the media URLs in an array in a Wix collection along with the rest of the data.

When a user selects a certain property, a function is run to propagate the gallery in batches (to help with network load) by setting the src and title:

//Batched version essentially wraps this in a setInterval
let galleryItems = ;
for ( const media of selectedComp . Media ) {
galleryItems . push ({
“src” : media . MediaURL ,
“title” : selectedComp . fullAddress + " - Image " + media . Order
$w ( “#gallery2” ). items = galleryItems ;

Unfortunately , the gallery crops the first batch correctly and is viewable in the expanded mode (5 photos for now), but all other photos aren’t sized properly and aren’t viewable in expanded mode.

Oddly enough, this gallery behavior is sporadic. My vertical gallery had this issue but seems to be solved by the batched loads. The only difference I can think of is that the vertical gallery is always in the viewport as photos are loaded (i.e. not hidden behind the wix pro scrolling).

Pictured are photos 3,4,5,6. 3,4,5 were the first batch and sized properly, 6 and beyond are pulling the photos but not resizing.

Thoughts on wix pro gallery behavior and increasing reliability?

Quick update! It may have been solved by slowing down the batches. Giving the gallery enough time to crop and resize before redefining the growing gallery array. Interrupting the resize process breaks the gallery.