Get Path from node ID
You should use Drupal 8 classes to generate the link. If you get the nid from an existing node object you can do the following in the .theme-file of your theme:

function yourtheme_preprocess_block(&amp;$vars) {
  $node = Drupal::request()-&gt;attributes-&gt;get('node');
  $vars['link'] = $node-&gt;toUrl()-&gt;setAbsolute();
}


In twig you can output:

&lt;div class="row columns"&gt;
    {% for key, image in imageurl %}
    &lt;div class="large-4 medium-3 column"&gt;
        &lt;a href="{{ link }}"&gt;
            &lt;img src="../sites/default/files/{{ image }}"/&gt;
        &lt;/a&gt;
        &lt;div&gt;
            {{ block_title[key] }}
        &lt;/div&gt;
    &lt;/div&gt;
    {% endfor %}
&lt;/div&gt;


To generate the URL of your node just knowing the nid (here in variable $nid) you can use the following in your .theme-file:

function yourtheme_preprocess_block(&amp;$vars) {
  $options = array('absolute' =&gt; TRUE);
  $url = \Drupal\Core\Url::fromRoute('entity.node.canonical', ['node' =&gt; $nid], $options);
  $vars['link'] = $url-&gt;toString();
}


Again you can use {{ link }} to output the URL where ever you need in yout twig template.