Improve image saving