fix errors of saving pics