'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):

    stats = []
    for path in get_all_regular_files(self.base_dir):
        file_info = os.stat(path)
        stats.append((file_info[stat.ST_ATIME], file_info[stat.ST_SIZE], path))
    if (not stats):
        return None
    stats.sort()
    return (os.path.basename(stats[0][2]), stats[0][1])
