Fixed a cross-browser bug involving images not getting encoded correctly after loading via XHR.