optimize saveImg2Local method