I thought I was being smart by uploading all the file into my root folder. because I wanted to embed in an old badly designed gallery page.
When using the baseUrl method of embedding, it does not matter where on your web server you upload the gallery folder to as long as the two paths in the embedding code (the path to the 'juicebox.js' file and the baseUrl itself, pointing towards the gallery folder) are correct.
You can essentially upload the gallery folder to anywhere on your server and still embed the gallery in any web page anywhere else on your server (as long as the paths in the embedding code are correct).
Of course uploading index file could have been a big problem.
Using the baseUrl method and keeping all the gallery files inside a gallery folder will prevent any existing files on your web server (such as an 'index.html' page) from being overwritten (as long as the name of the gallery folder itself does not clash with an existing directory name).