On my website I use the Responsive Lightbox & Gallery plugin
This works to full satisfaction, people can view large photos and browse to the next one.
I have blocks with text and blocks with photos in between, with the Responsive Lightbox & Gallery plugin on it.
So far, so good. But if people click on the first photo, they can view all the photos on that page in one go. While I only want to show the photos that are in that particular block (Gutenberg). Then stop looking enlarged photos, or repeat but do not continue to the photos of the next block that are a few blocks (with text) further away.