back button for navigation

pressing browser back button when gallery is open closes menu.