Added generic image upload functions