Add validation to upload image and clean up code