Checking of error was generated before returning error string
Checking of error was generated before returning error string
Switched order of params in ImageOutput Write function to match C++ API
return nil explicitly  for clarity