Hackish and incomplete but mostly-working image upload.