final fix for image upload