added proper support for animated gifs