Refactor GIF support

Remove GIF specific code from main source, isolate it in a UIImage category to ease future addition of format support