rewrite image model