Fixed script.js to read html tags in captions when switching images from inside the overlay