added checks to make sure the image upload works right if user decides to take 2nd image