Learning Sparse Image Codes using a Wavelet Pyramid Architecture