image rewrite postprocess function