Error handling if GIF is malformed. LZW now detects end of stream and stops gracefully.