More robust GIF parsing.