<div id="full">
<?php $i=0; $j=1; foreach ($array as $image) { ?>
<div id="image<?php echo $i;?>"
class="img bg-img<?php echo $j;?>">
<img src="<?php echo $image['image']; ?>" ></img>
</div>
<?php $j++; $i++;} ?>
</div>
How do i check if next picture exists or not
This will check if the image exists, and echo it if does. If not it will
breakout of the loop (essentially cancelling it. Depending on the data you may want to use acontinuein place of break