fix https://github.com/Pathologic/SimpleGallery/issues/41