A novel hierarchical approach to image retrieval is proposed. First, a color label histogram is used to effectively filter out the images that are not similar to the query image in color. The proposed color label histogram built by categorizing the pixel colors is computationally much more efficient compared to other approaches. Next, the class parameters of those images passing the first filter are used to identify the images similar to the query image in spatial layout. These class parameters are obtained automatically from the proposed unsupervised segmentation algorithm. Moreover, the wavelet decomposition coefficients are used to generate the initial partition for the segmentation algorithm. It doubles the segmentation performance. At the last stage, all images passing two filters are ranked based on the total normalized distance in color and spatial layout. The experiments show the effectiveness and efficiency of our approach.