gallery-save bug fix