Learning sparse wavelet codes for natural images