Memory based object recognition in images