Iplement saving image to file