Thanks for your help
This is how I have managed it
<?php
$quotes = array( 'post_type' => 'testimonial
', 'posts_per_page' => 12, 'orderby' => 'rand' );
// background-color: rgba(0,0,0,0.75);
$quotes_query = new WP_Query( $quotes );
// here you might wanna apply some sort of sorting on $result->posts
?>
<?php if( $quotes_query->have_posts() ): ?>
<div id="homepagegall" class="galleryimage">
<?php while( $quotes_query->have_posts() ) : $quotes_query->the_post();
//this is to create random background colours of text
$bgArray= array('#282E33', '#25373A', '#164852', '#495E67', '#FF3838','#FFFFFF');
//create a random number, then use the colour whos key matches the number
$myRand = rand(0,(6-1));
$val = $bgArray[$myRand];
?>
<div class="container left">
<?php $image = array(get_field('gallery',425), get_field('gallery',427) );
foreach( $image as $gallery ):
$rand = array_rand($gallery, 1);?>
<img src="<?php echo $gallery[$rand]['sizes']['thumbnail']; ?>" alt="<?php echo $gallery[$rand]['alt']; ?>" />
<?php endforeach;?>
<div class="textbox" style="background-color:<?php echo $val;?>">
<strong><?php the_title();?></strong>
<p class="text"><?php the_excerpt();?></p>
</div>
</div>
<?php endwhile; ?>
<div class="clear"></div>
</div>
<?php endif; ?>
<?php wp_reset_query(); // Restore global post data stomped by the_post(). ?>
Not very pretty as I am needing to manually put the id of the pages in get_field() callback but is working,
Although I am getting the same image multiple times but only have a few uploaded – will look into non duplicates in the array