Implements onerror for JpegStreams

Partly addresses #2812. It resolves the infinite loop and renders everything but the images.

Thanks to @yurydelendik for helping with debugging this!
make it a warning and change the text to something like 'Error during JPEG image loading'