Use XHR to load images if possible

If the btoa function is available, we use XHR to load the image, otherwise
we fall back to assigning the src to the image element. The benefit of
using XHR is that we can provide details on the error that occurred.