Prevent thumbnails being larger than original images