Clean image upload code