rss提供缩略图图像

I am trying to show the images in rss feed and would appreciate help please.

Here is my code

<?php
function fetch_news(){
    $data = file_get_contents('http://feeds.bbci.co.uk/news/rss.xml');
    $data = simplexml_load_string($data);

    foreach ($data->channel->item as $item) {
    $media = $item->children('http://search.yahoo.com/mrss/');

          print_r($media->thumbnail[0]->attributes());

        }

}

?>

and i am getting the folloing error

Fatal error: Call to a member function attributes() on a non-object in C:\wamp\www\ourProject\inc ews_reader.php