Start of gif parsing