preliminary animated .gif support

It sort of works, but remaining tasks are:
1. add caching
2. fix coloring issues (transparency?)
3. clean up code
4. if time, improve logic to fill in gaps