diff --git a/MediaRSS.info b/MediaRSS.info
index 09a3e9b..852fe14 100644
--- a/MediaRSS.info
+++ b/MediaRSS.info
@@ -1,9 +1,12 @@
 name = Media RSS
 description = Creates a media field for image nodes on RSS feeds
-package = Views
+core = 7.x
+dependencies[] = views
+package = "Views"
+
+files[] = MediaRSS.module
+files[] = MediaRSS.install
+files[] = plugins/views_plugin_row_mediarss.inc
 
-dependencies[]=views
 
-core = 6.x
 
- 
\ No newline at end of file
diff --git a/MediaRSS.install b/MediaRSS.install
index e4ac22f..be4601a 100644
--- a/MediaRSS.install
+++ b/MediaRSS.install
@@ -4,9 +4,9 @@
  * Implementation of hook_uninstall().
  */
 function mediarss_uninstall() {
-  foreach (node_get_types('names') as $typename => $visiblename) {
+  /**foreach (node_get_clear()('names') as $typename => $visiblename) {
     if (variable_get('mediarss_'. $typename, 0)) {
       variable_del('mediarss_'. $typename);
     }
-  }
+  }**/ //convert to 7.x
 }
\ No newline at end of file
diff --git a/MediaRSS.module b/MediaRSS.module
index 8af86da..2b9f36f 100644
--- a/MediaRSS.module
+++ b/MediaRSS.module
@@ -1,5 +1,5 @@
 <?php
-function mediarss_perm() {
+function mediarss_permission() {
   return array();
 }
 function mediarss_init() {
@@ -9,16 +9,16 @@ function mediarss_init() {
  * Implementation of hook_views_plugins
  */
 function mediarss_views_plugins() {
- return array(
-	'row' => array(
-		'mediarss' => array(
-			'title' => t('Media RSS'),
-			'help' => t('Generates an RSS feed with images from a view.'),
-			'handler' => 'views_plugin_row_mediarss',
-			'path' => drupal_get_path('module', 'mediarss') . '/plugins',
-			'uses options' => TRUE,
-			'type' => 'feed',
-		),
-	),
+  return array(
+    'row' => array(
+    'mediarss' => array(
+      'title' => t('Media RSS'),
+      'help' => t('Generates an RSS feed with images from a view.'),
+      'handler' => 'views_plugin_row_mediarss',
+      'path' => drupal_get_path('module', 'mediarss') . '/plugins',
+      'uses options' => TRUE,
+      'type' => 'feed',
+    ),
+   ),
   );
 }
\ No newline at end of file
diff --git a/plugins/views_plugin_row_mediarss.inc b/plugins/views_plugin_row_mediarss.inc
index 42719ac..14234f9 100644
--- a/plugins/views_plugin_row_mediarss.inc
+++ b/plugins/views_plugin_row_mediarss.inc
@@ -1,4 +1,5 @@
 <?php
+
 /**
  * @file
  * Contains the Meida RSS row plugin.
@@ -8,150 +9,151 @@
  * Media RSS row plugin to render an RSS feed.
  *
  */
-
 class views_plugin_row_mediarss extends views_plugin_row {
-function option_definition() {
+
+  function option_definition() {
     $options = parent::option_definition();
     $options['teaser']['item_length'] = array('default' => 'default');
     $options['mediarss_typename'] = array('default' => array());
     $options['mediarss_imgfield'] = array('default' => array());
     $options['teaser']['mediarss_cachepreset'] = array('default' => array());
-	$options['teaser']['item_picture_size'] = array('default' => 'preview');
-	$options['content']['mediarss_cachepreset'] = array('default' => array());
-	$options['content']['item_picture_size'] = array('default' => '_original');
-	$options['thumbnail']['mediarss_cachepreset'] = array('default' => array());
-	$options['thumbnail']['item_picture_size'] = array('default' => 'thumbnail');
-	$options['content']['mediarss_displaytitle']=true;
-	$options['teaser']['mediarss_allowcck']=false;
+    $options['teaser']['item_picture_size'] = array('default' => 'preview');
+    $options['content']['mediarss_cachepreset'] = array('default' => array());
+    $options['content']['item_picture_size'] = array('default' => '_original');
+    $options['thumbnail']['mediarss_cachepreset'] = array('default' => array());
+    $options['thumbnail']['item_picture_size'] = array('default' => 'thumbnail');
+    $options['content']['mediarss_displaytitle'] = TRUE;
+    $options['teaser']['mediarss_allowcck'] = FALSE;
     return $options;
   }
 
   function options_form(&$form, &$form_state) {
-
-  $nodetypes = node_get_types();
-  foreach ($nodetypes as $nodetype) {
-$nodetypes2[$nodetype->type]=$nodetype->name;
-}
-$form['mediarss_typename'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Node types to convert'),
-    '#options' => $nodetypes2,
-    '#default_value' => $this->options['mediarss_typename'],
-    '#description' => t("The content types you want images to be displayed for."),
-    '#weight' => -3,
-  );
-  $form['teaser'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Teaser/Body'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  );
-      $form['teaser']['item_length'] = array(
-      '#type' => 'select',
-      '#title' => t('Display type'),
-      '#options' => array(
-        'fulltext' => t('Full text'),
-        'teaser' => t('Title plus teaser'),
-        'title' => t('Title only'),
-        'fulltextpic2' => t('Full text plus pics'),
-	  'teaserpic2' => t('Title plus pictures plus teaser'),
-	  'titlepic2' => t('Title plus pictures'),
-	  'fulltextpic' => t('Full text plus single pic'),
-	  'teaserpic' => t('Title plus single picture plus teaser'),
-	  'titlepic' => t('Title plus single picture'),
-        'default' => t('Use default RSS settings'),
-      ),
-      '#default_value' => $this->options['teaser']['item_length'],
+    node_type_clear();
+    $nodetypes = node_type_get_types();
+    
+    foreach ($nodetypes as $nodetype) {
+      $nodetypes2[$nodetype->type] = $nodetype->name;
+    }
+    $form['mediarss_typename'] = array(
+        '#type' => 'checkboxes',
+        '#title' => t('Node types to convert'),
+        '#options' => $nodetypes2,
+        '#default_value' => $this->options['mediarss_typename'],
+        '#description' => t("The content types you want images to be displayed for."),
+        '#weight' => -3,
     );
-
-  $form['content'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Media:Content'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  );
-  $form['thumbnail'] = array(
-    '#type' => 'fieldset',
-    '#title' => t('Media:Thumbnail'),
-    '#collapsible' => TRUE,
-    '#collapsed' => FALSE,
-  );
-if(module_exists('imagefield') && module_exists('imagecache')){
-$cckimagefields =db_query("SELECT * FROM {content_node_field}");
-$cckimagefieldsarray=array();
-while ($cckimagefield = db_fetch_array($cckimagefields)){
-$cckimagefieldsarray[$cckimagefield['field_name']]=$cckimagefield['field_name'];
-}
-  $form['mediarss_imgfield'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('CCK ImageFields'),
-    '#options' => $cckimagefieldsarray,
-    '#default_value' => $this->options['mediarss_imgfield'],
-    '#description' => t("The field name you assigned to the CCK ImageField you wish to display."),
-    '#weight' => -2,
-  );
-  $form['teaser']['mediarss_allowcck'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Allow CCK and other modules to change node content'),
-    '#default_value' => $this->options['teaser']['mediarss_allowcck'],
-    '#description' => t("If checked it will allow CCK and other modules to change node content before it is displayed"),
-  );
-$form['content']['mediarss_displaytitle'] = array(
-    '#type' => 'checkbox',
-    '#title' => t('Use Image Title'),
-    '#default_value' => $this->options['content']['mediarss_displaytitle'],
-    '#description' => t("If checked it will replace node title for image title (if it has one) in the <media:title> tag"),
-  );
-$imagecachepresets= array();
-  foreach (imagecache_presets() as $preset) {
-    $imagecachepresets[$preset['presetname']] =$preset['presetname'];
-  }
-  $imagecachepresets['MediaRSSOriginal'] = 'Original Image';
-  $form['teaser']['mediarss_cachepreset'] = array(
-    '#type' => 'select',
-    '#title' => t('ImageCache Preset'),
-    '#options' => $imagecachepresets,
-    '#default_value' => $this->options['teaser']['mediarss_cachepreset'],
-    '#description' => t("The name of the ImageCache preset you want to use to display the images."),
-  );
-  $form['content']['mediarss_cachepreset'] = array(
-    '#type' => 'select',
-    '#title' => t('ImageCache Preset'),
-    '#options' => $imagecachepresets,
-    '#default_value' => $this->options['content']['mediarss_cachepreset'],
-    '#description' => t("The name of the ImageCache preset you want to use to display the images."),
-  );
-  $form['thumbnail']['mediarss_cachepreset'] = array(
-    '#type' => 'select',
-    '#title' => t('ImageCache Preset'),
-    '#options' => $imagecachepresets,
-    '#default_value' => $this->options['thumbnail']['mediarss_cachepreset'],
-    '#description' => t("The name of the ImageCache preset you want to use to display the images."),
-  );
-}
-if(module_exists('image')){
-foreach(image_get_sizes() as $key => $size){
-$imagesizes[$key]=$size['label'];
-}
-    $form['teaser']['item_picture_size'] = array(
-      '#type' => 'select',
-      '#title' => t('Image Module Picture Size'),
-      '#options' => $imagesizes,
-      '#default_value' => $this->options['teaser']['item_picture_size'],
+    $form['teaser'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Teaser/Body'),
+        '#collapsible' => TRUE,
+        '#collapsed' => FALSE,
     );
-    $form['content']['item_picture_size'] = array(
-      '#type' => 'select',
-      '#title' => t('Image Module Picture Size'),
-      '#options' => $imagesizes,
-      '#default_value' => $this->options['content']['item_picture_size'],
+    $form['teaser']['item_length'] = array(
+        '#type' => 'select',
+        '#title' => t('Display type'),
+        '#options' => array(
+            'fulltext' => t('Full text'),
+            'teaser' => t('Title plus teaser'),
+            'title' => t('Title only'),
+            'fulltextpic2' => t('Full text plus pics'),
+            'teaserpic2' => t('Title plus pictures plus teaser'),
+            'titlepic2' => t('Title plus pictures'),
+            'fulltextpic' => t('Full text plus single pic'),
+            'teaserpic' => t('Title plus single picture plus teaser'),
+            'titlepic' => t('Title plus single picture'),
+            'default' => t('Use default RSS settings'),
+        ),
+        '#default_value' => $this->options['teaser']['item_length'],
+    );
+
+    $form['content'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Media:Content'),
+        '#collapsible' => TRUE,
+        '#collapsed' => FALSE,
     );
-    $form['thumbnail']['item_picture_size'] = array(
-      '#type' => 'select',
-      '#title' => t('Image Module Picture Size'),
-      '#options' => $imagesizes,
-      '#default_value' => $this->options['thumbnail']['item_picture_size'],
+    $form['thumbnail'] = array(
+        '#type' => 'fieldset',
+        '#title' => t('Media:Thumbnail'),
+        '#collapsible' => TRUE,
+        '#collapsed' => FALSE,
     );
-}
+    if (module_exists('imagefield') && module_exists('imagecache')) {
+      $cckimagefields = db_query("SELECT * FROM {content_node_field}");
+      $cckimagefieldsarray = array();
+      while ($cckimagefield = db_fetch_array($cckimagefields)) {
+        $cckimagefieldsarray[$cckimagefield['field_name']] = $cckimagefield['field_name'];
+      }
+      $form['mediarss_imgfield'] = array(
+          '#type' => 'checkboxes',
+          '#title' => t('CCK ImageFields'),
+          '#options' => $cckimagefieldsarray,
+          '#default_value' => $this->options['mediarss_imgfield'],
+          '#description' => t("The field name you assigned to the CCK ImageField you wish to display."),
+          '#weight' => -2,
+      );
+      $form['teaser']['mediarss_allowcck'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Allow CCK and other modules to change node content'),
+          '#default_value' => $this->options['teaser']['mediarss_allowcck'],
+          '#description' => t("If checked it will allow CCK and other modules to change node content before it is displayed"),
+      );
+      $form['content']['mediarss_displaytitle'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Use Image Title'),
+          '#default_value' => $this->options['content']['mediarss_displaytitle'],
+          '#description' => t("If checked it will replace node title for image title (if it has one) in the <media:title> tag"),
+      );
+      $imagecachepresets = array();
+      foreach (imagecache_presets() as $preset) {
+        $imagecachepresets[$preset['presetname']] = $preset['presetname'];
+      }
+      $imagecachepresets['MediaRSSOriginal'] = 'Original Image';
+      $form['teaser']['mediarss_cachepreset'] = array(
+          '#type' => 'select',
+          '#title' => t('ImageCache Preset'),
+          '#options' => $imagecachepresets,
+          '#default_value' => $this->options['teaser']['mediarss_cachepreset'],
+          '#description' => t("The name of the ImageCache preset you want to use to display the images."),
+      );
+      $form['content']['mediarss_cachepreset'] = array(
+          '#type' => 'select',
+          '#title' => t('ImageCache Preset'),
+          '#options' => $imagecachepresets,
+          '#default_value' => $this->options['content']['mediarss_cachepreset'],
+          '#description' => t("The name of the ImageCache preset you want to use to display the images."),
+      );
+      $form['thumbnail']['mediarss_cachepreset'] = array(
+          '#type' => 'select',
+          '#title' => t('ImageCache Preset'),
+          '#options' => $imagecachepresets,
+          '#default_value' => $this->options['thumbnail']['mediarss_cachepreset'],
+          '#description' => t("The name of the ImageCache preset you want to use to display the images."),
+      );
+    }
+    if (module_exists('image')) {
+      foreach (image_get_sizes() as $key => $size) {
+        $imagesizes[$key] = $size['label'];
+      }
+      $form['teaser']['item_picture_size'] = array(
+          '#type' => 'select',
+          '#title' => t('Image Module Picture Size'),
+          '#options' => $imagesizes,
+          '#default_value' => $this->options['teaser']['item_picture_size'],
+      );
+      $form['content']['item_picture_size'] = array(
+          '#type' => 'select',
+          '#title' => t('Image Module Picture Size'),
+          '#options' => $imagesizes,
+          '#default_value' => $this->options['content']['item_picture_size'],
+      );
+      $form['thumbnail']['item_picture_size'] = array(
+          '#type' => 'select',
+          '#title' => t('Image Module Picture Size'),
+          '#options' => $imagesizes,
+          '#default_value' => $this->options['thumbnail']['item_picture_size'],
+      );
+    }
   }
 
   function render($row) {
@@ -159,7 +161,7 @@ $imagesizes[$key]=$size['label'];
     global $base_url;
 
     $item_length = $this->options['teaser']['item_length'];
-    
+
     if ($item_length == 'default') {
       $item_length = variable_get('feed_item_length', 'teaser');
     }
@@ -169,113 +171,105 @@ $imagesizes[$key]=$size['label'];
     }
     $this->view->style_plugin->namespaces['xmlns:media'] = 'http://search.yahoo.com/mrss/';
     // Load the specified node:
+
     $item = node_load($row->nid);
     $item->build_mode = NODE_BUILD_RSS;
     $item->link = url("node/$row->nid", array('absolute' => TRUE));
 
-    $teaser = ($item_length == 'teaser'|| $item_length == 'teaserpic' || $item_length == 'teaserpic2') ? TRUE : FALSE;
-      // Filter and prepare node teaser
-    if (node_hook($item, 'view')) {
-      $item = node_invoke($item, 'view', $teaser, FALSE);
-    }else {
-      $item = node_prepare($item, $teaser);
-    }
+    $teaser = ($item_length == 'teaser' || $item_length == 'teaserpic' || $item_length == 'teaserpic2') ? TRUE : FALSE;
+    // Filter and prepare node teaser
+    //if (node_hook($item, 'view')) $item = node_invoke($item, 'view', $teaser, FALSE);
+    //else $item = node_prepare($item, $teaser);
     // Allow modules to change $node->teaser before viewing.
-    if($this->options['teaser']['mediarss_allowcck']==True){
-		node_invoke_nodeapi($item, 'view', $teaser, FALSE);
-		$item_content = drupal_render($item->content);
-	}else{
-		if($teaser){
-			$item_content = ($item->teaser);
-		}else{
-			$item_content = ($item->body);
-		}
-	}
-	
+    if ($this->options['teaser']['mediarss_allowcck'] == True) {
+      module_invoke_all('node_', $item, 'view', $teaser, FALSE);
+      $item_content = drupal_render($item->content);
+      } 
+    else {
+      if ($teaser) $item_content = ($item->teaser); 
+      else $item_content = ($item->body);
+    }
+
     // Allow modules to add additional item fields and/or modify $item
-    $extra = node_invoke_nodeapi($item, 'rss item');
-    $extra = array_merge($extra,
-      array(
+    $extra = module_invoke_all('node_', $item, 'rss item');
+    $extra = array_merge($extra, array(
         array('key' => 'pubDate', 'value' => gmdate('r', $item->created)),
         array('key' => 'dc:creator', 'value' => $item->name),
         array(
-          'key' => 'guid',
-          'value' => $item->nid . ' at ' . $base_url,
-          'attributes' => array('isPermaLink' => 'false')
+            'key' => 'guid',
+            'value' => $item->nid . ' at ' . $base_url,
+            'attributes' => array('isPermaLink' => 'FALSE')
         ),
-	  )
-    );
-	$titlekey = array('key' => 'media:title', 'attributes' => array('type' => 'plain',), 'value' => $item->title);
-	$creditrolePhotographer = array('key' => 'media:credit', 'attributes' => array('role' => 'photographer',), 'value' => $item->name);
-	$imagefields = $this->options['mediarss_imgfield'];
-	foreach($this->options['mediarss_typename'] as $mediarsstype){
-	//$item->teaser.=$mediarsstype.' ';
-	if($item->type==$mediarsstype && $mediarsstype!='0' && $mediarsstype=='image' && module_exists('image')){
-	   if($item->images){
-	   //$item->teaser.="image-loop ";
-	   $attributes['url'] =  file_create_url($item->images[$this->options['thumbnail']['item_picture_size']]);
-         $media['url'] =  file_create_url($item->images[$this->options['content']['item_picture_size']]);
-         $media['type'] = file_get_mimetype($item->images[$this->options['content']['item_picture_size']]);
- $extra = array_merge($extra,
-array(
-        array('key' => 'media:content', 'attributes' => $media, 'value'=>array(
-		$titlekey,
-        $creditrolePhotographer,
-		),
-		array('key' => 'media:thumbnail', 'attributes' => $attributes),
-		)
-      )
+            )
     );
-$picture_text2 = l(image_display($item, $this->options['teaser']['item_picture_size']), url('node/'.$item->nid, array('absolute' => TRUE)), array('html' => TRUE));
-$picture_text = $picture_text2;
- $media=array();
-$attributes=array();
-}
-}
-if(module_exists('imagefield') && $item->type==$mediarsstype && $mediarsstype!='0'){
-	//$item->teaser.="imagefield-type ";
-		$picture_text3="";
-		foreach($imagefields as $imagefield){
-			if($item->{$imagefield}){
-			foreach($item->{$imagefield} as $itemImagefield){
-			if($itemImagefield['filepath']){
-	                  //$item->teaser.="imagefield-loop ";
-				$imagecache = $this->options['mediarss_cachepreset'];
-				$picture_text = l(theme('imagecache', $this->options['teaser']['mediarss_cachepreset'], $itemImagefield['filepath']), url("node/".$item->nid, array('absolute' => TRUE)), array('html'=> TRUE));
-				if ($this->options['content']['mediarss_cachepreset']=='MediaRSSOriginal'){
-					$contentfilepath=$base_url."/".$itemImagefield['filepath'];
-				}else{
-					$contentfilepath = imagecache_create_url($this->options['content']['mediarss_cachepreset'], $itemImagefield['filepath']);
-				}
-				if ($this->options['thumbnail']['mediarss_cachepreset']=='MediaRSSOriginal'){
-					$thumbnailfilepath=$base_url."/".$itemImagefield['filepath'];
-				}else{
-					$thumbnailfilepath=imagecache_create_url($this->options['thumbnail']['mediarss_cachepreset'], $itemImagefield['filepath']);
-				}
-				$attributes['url'] =  $thumbnailfilepath;
-				$media['url'] = $contentfilepath;
-				$media['type'] = file_get_mimetype($media['url']);
-				if($this->options['content']['mediarss_displaytitle']){
-					$image_title = isset($itemImagefield['data']['title']) ? $itemImagefield['data']['title'] : $item->title;
-					$titlekey = array('key' => 'media:title', 'attributes' => array('type' => 'plain',), 'value' => $image_title);
-				}
-				$extra = array_merge($extra,
-					array(
-						array('key' => 'media:content', 'attributes' => $media, 'value'=>array(
-							$titlekey,
-							$creditrolePhotographer,
-							array('key' => 'media:thumbnail', 'attributes' => $attributes),
-							)
-						),
-					)
-				);
-				$picture_text3.=$picture_text;
-				}
-				}
-			}
-		}
-	}
-}
+    $titlekey = array('key' => 'media:title', 'attributes' => array('type' => 'plain', ), 'value' => $item->title);
+    $creditrolePhotographer = array('key' => 'media:credit', 'attributes' => array('role' => 'photographer', ), 'value' => $item->name);
+    $imagefields = $this->options['mediarss_imgfield'];
+    foreach ($this->options['mediarss_typename'] as $mediarsstype) {
+      //$item->teaser.=$mediarsstype.' ';
+      if ($item->type == $mediarsstype && $mediarsstype != '0' && $mediarsstype == 'image' && module_exists('image')) {
+        if ($item->images) {
+          //$item->teaser.="image-loop ";
+          $attributes['url'] = file_create_url($item->images[$this->options['thumbnail']['item_picture_size']]);
+          $media['url'] = file_create_url($item->images[$this->options['content']['item_picture_size']]);
+          $media['type'] = file_get_mimetype($item->images[$this->options['content']['item_picture_size']]);
+          $extra = array_merge($extra, array(
+              array('key' => 'media:content', 'attributes' => $media, 'value' => array(
+                      $titlekey,
+                      $creditrolePhotographer,
+                  ),
+                  array('key' => 'media:thumbnail', 'attributes' => $attributes),
+              )
+                  )
+          );
+          $picture_text2 = l(image_display($item, $this->options['teaser']['item_picture_size']), url('node/' . $item->nid, array('absolute' => TRUE)), array('html' => TRUE));
+          $picture_text = $picture_text2;
+          $media = array();
+          $attributes = array();
+        }
+      }
+      if (module_exists('imagefield') && $item->type == $mediarsstype && $mediarsstype != '0') {
+        //$item->teaser.="imagefield-type ";
+        $picture_text3 = "";
+        foreach ($imagefields as $imagefield) {
+          if ($item->{$imagefield}) {
+            foreach ($item->{$imagefield} as $itemImagefield) {
+              if ($itemImagefield['filepath']) {
+                //$item->teaser.="imagefield-loop ";
+                $imagecache = $this->options['mediarss_cachepreset'];
+                $picture_text = l(theme('imagecache', $this->options['teaser']['mediarss_cachepreset'], $itemImagefield['filepath']), url("node/" . $item->nid, array('absolute' => TRUE)), array('html' => TRUE));
+                if ($this->options['content']['mediarss_cachepreset'] == 'MediaRSSOriginal') 
+                  $contentfilepath = $base_url . "/" . $itemImagefield['filepath'];
+                else
+                  $contentfilepath = imagecache_create_url($this->options['content']['mediarss_cachepreset'], $itemImagefield['filepath']);
+                if ($this->options['thumbnail']['mediarss_cachepreset'] == 'MediaRSSOriginal') 
+                  $thumbnailfilepath = $base_url . "/" . $itemImagefield['filepath'];
+                else
+                  $thumbnailfilepath = imagecache_create_url($this->options['thumbnail']['mediarss_cachepreset'], $itemImagefield['filepath']);
+                
+                $attributes['url'] = $thumbnailfilepath;
+                $media['url'] = $contentfilepath;
+                $media['type'] = file_get_mimetype($media['url']);
+                if ($this->options['content']['mediarss_displaytitle']) {
+                  $image_title = isset($itemImagefield['data']['title']) ? $itemImagefield['data']['title'] : $item->title;
+                  $titlekey = array('key' => 'media:title', 'attributes' => array('type' => 'plain', ), 'value' => $image_title);
+                }
+                $extra = array_merge($extra, array(
+                    array('key' => 'media:content', 'attributes' => $media, 'value' => array(
+                            $titlekey,
+                            $creditrolePhotographer,
+                            array('key' => 'media:thumbnail', 'attributes' => $attributes),
+                        )
+                    ),
+                        )
+                );
+                $picture_text3.=$picture_text;
+              }
+            }
+          }
+        }
+      }
+    }
     foreach ($extra as $element) {
       if (isset($element['namespace'])) {
         $this->view->style_plugin->namespaces = array_merge($this->view->style_plugin->namespaces, $element['namespace']);
@@ -297,22 +291,22 @@ if(module_exists('imagefield') && $item->type==$mediarsstype && $mediarsstype!='
         $item_text = '';
         break;
       case 'fulltextpic2':
-        $item_text = $picture_text2.$picture_text3.$item_content;
+        $item_text = $picture_text2 . $picture_text3 . $item_content;
         break;
       case 'teaserpic2':
-        $item_text = $picture_text2.$picture_text3.$item_content;
+        $item_text = $picture_text2 . $picture_text3 . $item_content;
         if (!empty($item->readmore)) {
           $item_text .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
         }
         break;
       case 'titlepic2':
-        $item_text = $picture_text2.$picture_text3;
+        $item_text = $picture_text2 . $picture_text3;
         break;
       case 'fulltextpic':
-        $item_text = $picture_text.$item_content;
+        $item_text = $picture_text . $item_content;
         break;
       case 'teaserpic':
-        $item_text = $picture_text.$item_content;
+        $item_text = $picture_text . $item_content;
         if (!empty($item->readmore)) {
           $item_text .= '<p>' . l(t('read more'), 'node/' . $item->nid, array('absolute' => TRUE, 'attributes' => array('target' => '_blank'))) . '</p>';
         }
@@ -320,9 +314,9 @@ if(module_exists('imagefield') && $item->type==$mediarsstype && $mediarsstype!='
       case 'titlepic':
         $item_text = $picture_text;
         break;
-	default:
-		$item_text = $item_content;
-		break;
+      default:
+        $item_text = $item_content;
+        break;
     }
 
     return format_rss_item($item->title, $item->link, $item_text, $extra);
