fixes image saving