Corrected image saving bug