Use imagesLoaded plugin to detect image loading

Use the imagesLoaded jQuery plugin to detect when images are being
loaded to trigger our handler to resize the image containers and
captions.

Closes #622
Merge branch 'hotfix-622-scale_viewer_image_borders' into develop

Conflicts:
	README.rst