def getRecentlyViewed(startingUrl=None):
    """Retrieves and returns the list of recently viewed images."""
    if startingUrl is None:
        startingUrl = "http://xhamster.com/photos/view/1612021-26469404.html#imgTop"

    data = wget(startingUrl)

    d = pq(data)

    #    imageFileUrl = d('img#imgSized').attr.get('src', None)
    #    if imageFileUrl is not None:
    #        imageData = wget(imageFileUrl, referer=startingUrl)
    #        storeImage(image.url, imageData)
    #    #imgLink = d('img#imgSized')[0].values()

    recent = d("div.imgListRecent a")
    for r in recent:
        r.values()
    images = map(lambda r: Image(r.values()[0]), filter(lambda r: len(r.values()) == 1, recent))
    storeRecentImagesSnapshot(images)
    return images
    url = 'http://www.elegantmatures.net/'
    url = 'http://www.pornmaturepics.com/'
    url = 'http://www.allmaturepics.net/'
    url = 'http://www.hairymoms.net/'
    url = 'http://www.uniquesexymoms.com/'
    url = 'http://www.bushypussies.net/'
    url = 'http://www.jugride.com/'
    url = 'http://www.ladylana.com/?x=5767.5383.9025.'
    url = 'http://www.dianapost.com/'
    url = 'http://www.inlovewithboobs.com/'
    url = 'http://www.amandalist.com/'
    url = 'http://www.anyfoxy.com/'
    url = 'http://www.anysmut.com/?x=9839.8219.'
    url = 'http://www.mulligansmilfs.com/'
    url = 'http://www.mature-post.com/pictures/search/?q=Plump|Plumper&kwid=5677&c=1'
    url = 'http://www.coonyboobs.com/'
    url = 'http://www.bigtitsmilf.com/pics/mature-big-t**s/'
    url = 'http://www.matureblast.com/main.php'
    url = 'http://www.momshere.com/'
    url = 'http://www.sexy-olders.com/'
    url = 'http://fresholders.com/'
    html = wget(url, referer=url)
    links = auto.autoExtractGalleryLinks(url, html)
    if links is not None:
        print links
        print 'url: %s, count: %s' % (url, len(links))
    else:
        print 'Failed, no matches found for url=%s' % url