Add New River post for shared image in photo gallery

Hi

         I try this last 2 hour, i need shared my own image or my friends image to all my friend, so add in the river post i try same code but it's not working, check the code below

                   add_to_river('river/share/create', 'shared', $guid, elgg_get_logged_in_user_guid());

$guid is image guid.

create.php file code below

 

$subject = $vars['item']->getSubjectEntity();
$object = $vars['item']->getObjectEntity();

$subject_icon = elgg_view_entity_icon($subject, 'tiny');
$object_icon = elgg_view_entity_icon($object, 'tiny');

echo elgg_view('river/elements/layout', array(
    'item' => $vars['item'],
    'attachments' => $subject_icon . elgg_view_icon('arrow-right') . $object_icon,
));

 

I need to view like  "User Shared image_name of user2" or  "User Shared image_name of own"

 When click on  the image name move to that image.

please check the code,if any problem in the code ..