Added code to upload the images using AJAX