I believe the ideal solution is:

1. Determine the URL of the image by taking `direct_url` if there is one, and falling back to the vanilla Glance URL if there isn't.
2. Maintain a map of protocol handlers, which take a URL and return a URL plus some extra data. You only need one by default, for `swift+http`.

Error out if no handler is found for the protocol. In the future we can implement support for vanilla glance or other URL schemes (bit torrent?).