added SGI image format, encoding and decoding, courtesy of Todd Kirby