Right now, the gallery will fetch individual media items, then group them by post afterwards. The problem with this is, if a post has a large number of media items, it will eat up the budgeted loading count per page for a much smaller number of shown items, causing pagination while scrolling to seem shorter than it technically is.
To solve this, we should be loading the first media item of each post, and then lazily loading the rest of the media items when the user enters the lightbox.
Right now, the gallery will fetch individual media items, then group them by post afterwards. The problem with this is, if a post has a large number of media items, it will eat up the budgeted loading count per page for a much smaller number of shown items, causing pagination while scrolling to seem shorter than it technically is.
To solve this, we should be loading the first media item of each post, and then lazily loading the rest of the media items when the user enters the lightbox.