I ended up with this:
<?php $rows = get_field('field'); if($rows) $i = 0; { shuffle( $rows ); foreach($rows as $row) { $i++; if($i==13) break; $image = wp_get_attachment_image_src( $row['subfield1'], 'full' ); ?>
<div class="class"><a href="<?php echo $row['subfield2']; ?>"><img src="<?php echo $image[0]; ?>" alt="<?php echo $image['alt']; ?>" /></a></div>
<?php } } ?>