I have created a very similar plugin https://wordpress.org/plugins/gallery-block-lightbox/ My plugin is using baguetteBox.js, written in pure JavaScript with no no dependencies (e.g. jQuery) baguetteBox.js relies on the tags around an image but since WP 5.6 it’s again possible to set a default link to target for the image and gallery block.