I'm going out on a bit of a limb here. But this probably won't work without having featherlight present on your site.
Here's a link to the documentation https://noelboss.github.io/featherlight/
& Here's a tutorial for how to instal it on a squaresspace site . https://www.spacetutorials.com/squarespace-lightbox/setup
Lovely bit of coding by @RobPegurri, Thanks