We present a mechanism called the Markov model mediator (MMM) to facilitate the effective retrieval for content-based image retrieval (CBIR). Different from the common methods in content-based image retrieval, our stochastic mechanism not only takes into consideration the low-level image content features, but also learns high-level concepts from a set of training data, such as access frequencies and access patterns of the images. The advantage of our proposed mechanism is that it exploits the structured description of visual contents as well as the relative affinity measurements among the images. Consequently, it provides the capability to bridge the gap between the low-level features and high-level concepts. Our experimental results demonstrate that the MMM mechanism can effectively assist in retrieving more accurate results for user queries.