small bug in amazon image upload code