Thanks. I cannot change code where i am right now. Here is a snippet from the Bluimp description:
Include the Gallery script at the bottom of the body of your webpage.
Note: It must be before the last script in the MercatorCreateGallery.php
Can you try that, ie include the script not in the header but at the bottom of the body?