Resize gifs better

I now handle animated images specially (they will not preserve aspect ratio automatically but they will still be animated after resizing) and properly upscale non-animated gifs.