1. A method comprising: receiving an image at a computing device; detecting a face in the image by the computing device; identifying a plurality of facial components of the detected face in the image by the computing device; generating a plurality of visual words from the identified plurality of facial components by the computing device; comparing the generated plurality of visual words from the identified facial components with a plurality of stored visual words by the computing device, wherein each visual word is associated with one of a plurality of stored images; determining a plurality of candidate matching images from the plurality of stored images based on the comparison by the computing device; selecting a plurality of reference images from the plurality of candidate matching images by the computing device; for each candidate matching image of the plurality of candidate matching images, determining a distance between the candidate matching image and each reference image of the plurality of reference images by the computing device; and ranking the candidate matching images based on the determined distances by the computing device.