Better error handling + WriteFile support

- I added a little better error handling around GetDimensions.
- I added a WriteFile function as well as ImageType constants

On my machine, using NewPixFromFile and WriteFile to convert from
tif to png is 6x faster than ImageMagick and 2.5 times faster than
GraphicsMagick.