GEOS-5704, GEOS-5703: fixing a couple of TurboJPEG issues