Bugfix for thumbnail generation when image is square