Improved image saving