Refactors buildImage to use Promise; don't draw bad images

- Removes LegacyPromise from image.js
- More generic case for #4575 type of exception
- Allows bad images to be skipped in canvas.js