Cleanup and fixed the draw image methods in the matrix class.
And added wavelet support to the analysis method