A Ranking Based Model for Automatic Image Annotation in a Social Network