I am displaying images which can be clicked to be opened in a modal box (like this plugin does) and zoomed when pinched on touch devices (like this demo).
The actual modalbox is as follows:
It displays the image and a simple navigation at the top right of the screen. The navigation has a left, right and close buttons.
When viewing the site on a mobile device I noticed some users press the browser back button when they want to close the modalbox. This makes the browser get out of the site. I already changed the background color of the navigation from white (which was meant to be less intrusive) to dark.
From a user experience perspective, is it recommended to push an extra browser history state (when opening the modal box) in case users press the back button?
(something like: www.example.com/#img1)
Is there any thought or common way of approaching modal boxes?