Adaptation to high spatial inhomogeneity using wavelet methods