Title: Lazy Loading using Block Gallery Plugin
Last modified: December 4, 2019

---

# Lazy Loading using Block Gallery Plugin

 *  [FrankD](https://wordpress.org/support/users/frankddo/)
 * (@frankddo)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/lazy-loading-using-block-gallery-plugin/)
 * Hi,
 * when using the block gallery plugin and autoptimize with lazy loading active,
   the images get stacked and cropped when viewing is set to masonry. I also tried
   out the beta version of AO, but got the same results.
    Intersting thing is, that
   in edit block view it’s working perfect and all images have the correct size 
   and border.
 * Problem for me is that I don’t know in which plugin this can be fixed, so that
   I also created a topic in the block gallery support forum:
 * [https://wordpress.org/support/topic/lazy-loading-block-gallery/#post-12203167](https://wordpress.org/support/topic/lazy-loading-block-gallery/#post-12203167)
 * I can’t post URL here, because website is not active atm – but If you need more
   infos please let me know.
 * thanks and best regards, Frank

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/lazy-loading-using-block-gallery-plugin/#post-12203231)
 * The issue is very likely that the blocks are rendered (placed) using JS which
   probably doesn’t see the images yet due to them being lazyloaded.
 * You’ll have to try to exclude those gallery images from being lazyloaded, by 
   adding one of the attributes of the `<img` tag (typically one of the `class` 
   names) to the layzload exclusion field.
 * Lastly, not (directly) related to your issue; as you’re using AO you undoubtedly
   consider performance important. In that context do take into account that using
   blocks in the frontend often adds _a lot_ of JS to your page(s), making your 
   site … slower. Might be that the block gallery is doing this in a smarter way,
   limiting the impact, but you might want to test the amount of JS on a page with
   a gallery.
 *  Thread Starter [FrankD](https://wordpress.org/support/users/frankddo/)
 * (@frankddo)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/lazy-loading-using-block-gallery-plugin/#post-12205944)
 * Excluding these images from lazy loading does not make sense for me. This single
   page contains a complete nice overview of all pictures (just visible for me!)
   and because the amount I was lucky that AO now contains a lazy load function.
 * You are right with your thoughts about blocks, js and performance. But thanks
   to AO the website runs very fast except of this one special page!
 * Thanks, Frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/lazy-loading-using-block-gallery-plugin/#post-12206023)
 * afraid from AO’s side there’s no workaround but to exclude those gallery images
   from lazyload frankddo :-/

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Lazy Loading using Block Gallery Plugin’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/lazy-loading-using-block-gallery-plugin/#post-12206023)
 * Status: not resolved