[libsocialcache] Improve image downloader output path generation

Previously, the output path depended solely on the identifier passed
in for the image.  This commit adds a function which takes both an
identifier and the URL of the remote image, and uses a path generation
strategy which should result in minimal file-path collision if the
remote URL changes.