Pass the image format to .save in `optimize_image`