Fix image rewrite for html files