implemented chunked reading as introduced by JpegIO.