I could perhaps add this as an option, but I have never seen a popup-gallery that closes when clicking the image. Surely the user would get confused by this if they expect navigating or even zooming the image?
There are also so many other ways to close the image (popup): close button, [esc] keyboard button, scroll up or down, swipe/drag up or down.