mat2Img convertion updated