How to add link internal or external to an image in a view for a slideshow? I need a slideshow and sometime the images need to have a link. This link might be external or internal and it is posted by users. I use rewrite results in my view. However, sometimes the picture does not have a link. So this does not work for me. 

I am using Drupal 7, Views, link and slideshow, picture module. My content type has the following fields: 


field_slideshow_image 
field_link_in_picture 
text_slideshow


I try used another modules but I need to use the picture module to make my pictures responsiveness.  Other modules require that use the Formatter in views and picture module uses its own format.
I solved using theming in the view. I use the template in the image field. I ended up with a template like views-view-field--field-slideshow-image.tpl.php. 

  &lt;?php 
//dpm($row); only work if devel module enabled

$url='';

if (!empty($row-&gt;field_field_link_in_picture_)){

    $url=($row-&gt;field_field_link_in_picture_[0]['raw']['url']); 

}

if (!empty($url)) { 
     echo "&lt;a href='$url'&gt;" .$output ."&lt;/a&gt;"; //print image with link    
}
else {
    print $output; //print image
}

?&gt;


If someone knows a better way to do this please feel post it here. If I am not doing something in the Drupal way please let me know or you have another way to accomplish this. I would love to hear it :) 

If you know little  about theming views you can check this video to understand better
Theming Views