Actually write imageMat contents to file