moved the base64work inside of the success promise callback

I have moved the call to getBase64Image inside of the success return due to it erroring when an image is not loaded. Tested as much as I can on local need to deploy to see if this works.