Image IO: fixed legacy handling of uri

Moved legacy specific workarounds out of ImageStorage:
legacy needs to store image path relatively to the document root
(var/site/storage/images/1/2/3/4/1234.jpg) while the IO API uses
a namespaced id (1/2/3/4/1234.jpg).

This particular handling is now done in the converter and the
gateway, and therefore restricted to legacy.