Support for saving gif images

a `case` here would be cleaner and easier to extend for other image formats