inverting order when uploading images