A script for a photo gallery/slideshow
I'm not a JS guy, so I focus on your HTML and CSS.

HTML


You're using the HTML5 doctype, so you can safely ommit the type-attribute on the script-tag
Add the viewport meta tag to the head-area to ensure correct viewport behavior on mobile devices:&lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;(Note: I left out the self-closing / for the meta tag as well)
Avoid using ID's excessively; Things like caption and even a gallery itself are likely to occur multiple times on the same page &ndash; Classes are more appropriate there


CSS:


You have an error in the .imgThumbnails -rule, where you use a hover-property; There is no such property!
Side note: There is also no semi-colon. Although one can ommit the last semi-colon in a list of property-declarations, I highly encourage anyone not to do this. It just leads to unnecessary trouble
You're using a lot of fixed widths and heights. This is very restrictive and should be avoided.


Before I get deeper in to making suggestions on how to improve your code further, it would be great to have some kind of demo. This doesn't need to be a working example of your gallery, you can use placeholders instead of images.