added check for correct ouptut suffixes in vtkImageWrite