Minor cleanups, added transparency flag (doesn't work with gif images?), height and width no longer reversed.