Fixes jsgallery bug