Small fix for jpegs corrupted by det