I'm not exactly sure what is causing your problem but your embedding code is a little non-standard (loading the 'juicebox.js' file from a location other than a 'jbcore' folder, using JavaScript to set configuration options in an external file and running the setGallerySize() API method when the resize event is fired) and might somehow be contributing to your problem.
Here are a few things you could check or try.
(1) See if the problem happens in our own Pro Embedded demo gallery.
This might help to determine whether or not the problem is unique to your own web page.
(2) Try locking the viewport on your web page. Change:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
... to:
<meta name="viewport" id="jb-viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" />
(3) You have set buttonBarPosition="NONE". This disables the entire Button Bar, including the Expand/Close Button which is the recommended method of closing an expanded gallery. Try setting buttonBarPosition="OVERLAY" and showExpandButton="TRUE" and try closing the expanded gallery with the Expand/Close Button (to return to your main page).
(4) Try embedding a more basic gallery into your main page as a test case using the recommended baseUrl embedding code here (rather than using your custom JavaScript code). If this works, then you can introduce elements of your custom JavaScript code to see if you can find the source of the problem.
I'm not sure if any of these suggestions will work but I hope they at least point you in the right direction.