rewrite image module