Changed check for library type.
Added flag for PNG format. Some operations need this format for the target file.