added power of 2 dimension check and error message to Haar2d