Performance Improvements

Improve performance when decoding large JPEGs, which came up when working on 
https://github.com/mozilla/pdf.js/issues/4436