'Return a tuple containing the image_id and size of the least recently
accessed cached file, or None if no cached files.'

def get_least_recently_accessed(self):

    with self.get_db() as db:
        cur = db.execute('SELECT    image_id    FROM    cached_images\n                                                                                                                    ORDER    BY    last_accessed    LIMIT    1')
        try:
            image_id = cur.fetchone()[0]
        except TypeError:
            return None
    path = self.get_image_filepath(image_id)
    try:
        file_info = os.stat(path)
        size = file_info[stat.ST_SIZE]
    except OSError:
        size = 0
    return (image_id, size)
