HTMLZ Output: Fix handling of images with URL unsafe filenames

Fixes #1192687 [htmlz output not rewriting img and urls](https://bugs.launchpad.net/calibre/+bug/1192687)