save image function changes