TMI-74: Make JPEG segment parsing more lenient