Deal with animated gifs (issue #60)

Don't merge this yet. I need to test it locally but this is should do it.