Well it's sorted now and apologies for not showing code previously, here's one solution that worked for me;
<?php endif; ?>
<?php if (have_posts()) : while (have_posts()) : the_post();
$attachments = attachments_get_attachments();
$total_attachments = count($attachments);
if( $total_attachments > 0 ) :
for ($i=0; $i < $total_attachments; $i++) : ?>
<div><img src="<?php echo $attachments[$i]['location']; ?>" alt="<?php echo $attachments[$i]['caption']; ?>" title="<?php echo $attachments[$i]['title']; ?>">
<?php if($attachments[$i]['caption']==""){
$new_caption=$attachments[$i-1]['caption'];
}else{
$new_caption=$attachments[$i]['caption'];
}
?>
<h2 id="tagline" title="<?php echo $attachments[$i]['title']; ?>"><?php echo $new_caption; ?></h2>
</div>
<?php endfor; ?>
<?php endif; ?>
<?php endwhile; else: ?>