Do not create an empty file if image saving fails