rewrite image cache