Shape-Preserving Wavelet-Based Density Estimation With Applications to Image Analysis