fix jpeg decoder bugs causing some images not to load.