overlayVisible thumbnail click bug

I noticed that, when the overlay was already opened and a user clicked on a thumbnail, the index in the memory would change but the clicked image didn't show.
This is easily fixable by copying the `offsetSlider(index);` instruction inside the `overlayVisible` if.
Hope this is helpful.