Small fix for jpegs corrupted by det. v2