https://github.com/Pathologic/SimpleGallery/issues/10 and other