Fix small bug with image saving