Added covariance matrix file IO and fixed bug with image file IO.