need to figure out a way to convert matrix to image