Improve on recent inline image changes.

Storing unique ID as key value and using the URL as the actual key so that we only have to query the URL as the key to check for duplicates instead of enumerating throughout the dictionary each time to find duplicates.