Referencing uploaded files in Drupal templates can be problematic - Drupal provides a link to the file in it's own format:


This isn't very useful when you need to display the image, since you can't use the public:// link directly. However! You can use the built-in Drupal method file_create_url() to generate a usable path (in this example, I'm getting the file URI by accessing the relevant field in the $node variable):

// this is the public:// link which Drupal provides
$img_src = $content['field_articles']['#object']->field_articles[$language][$i]['entity']->field_image[$language][0]['uri'];

// convert the link into a usable path
$image = file_create_url($img_src);

This results in Sorted.