Refactored the image upload handler, responding with correct urls to the jQuery