Overview
Add an optional attribute to images on Snap.as that indicate a particular purpose, or usage slot, for them, e.g. a user avatar or blog favicon. Applications can then upload to this usage slot, and replace any current image, if one exists.
Implementation
Add a new column to the snap_photos database table, e.g. app_use_id, and index it with the owner_id.
On upload, if an app_use_id is given, store this. If there is a conflict, i.e. the owner+useID already exist, then delete the old photo (both file and DB entry) and upload the new one and insert into the DB.