Community Detection in Medical Image Datasets: Using Wavelets and Spectral Clustering