Added support for writing animated gif.