retrieve assets from an entries
You could try something like:

{% for entry in entries %}
  {% for image in entry.portfolio.orderBy('RAND()').limit(8)
    &lt;img src="{{ image.getUrl() }}"&gt;
  {% endfor %}
{% endfor %}