forgot to separate save image logic