bug fix saving image