Fix image upload controllers

ActiveRecord deletes has_one associated records before saving the new
ones.