How to use Anchor image in Masonry

I got Masonry component to work with an image but now I would like to have images open in a lightbox.

So i added an Anchor image instead and configured for lightbox (this part works)

However the Images are not listed in Masonry style, just large images one after the other.
Removing the Anchor, the image get processed as Masonry and display correctly.

I can only imagine that the component is trying to process the a tags and not the img tags to determine the dimensions.

Is there a better way to do this?
thanks

Community Page
Last updated: