Fix for image saving