Unquote URL before saving image cache.

Also some Python 3 fixes, discovered by mocking less in order to test
more of the code flow.