Image upload process refactored into component