updated image saving