Fix animated gif generation.