Fix saving image dimensions when resizing for thumbnails