I moved this method to the Lightbox component object and made it work with the main close button, not the close button in the share screen.