Add basic infrastructure for animation

Add the Frame type to support sub-images. This also fixes issues with some  animated gif image. Furthermore these commit should fix most issues with gif.

Fixes #91.