added js to handle image upload in b64