progress writing a gif decoder