fix saving image