Fix image save bug