<div class="main_block">
<?php
        echo '<table style="width:100%;" cellspacing="10">';
        $i=0;
        foreach($articles as $article){
                if($i == 0){
                        echo '<tr>';
                }
                        echo '<td class="imagediv">';
                                if(isset($article['photo'])){
                                        $link = '/'.url_title($article['name'], 'dash', TRUE).'-6-'.$this->localization['meta_data']['idlanguages'].'-'.$article['idgalleries'].'.html';
                                        echo '<a href="'.$link.'">';
                                                echo '<img src="/files/img/galleries/'.$article['photo']['idgalleries'].'/min/'.$article['photo']['path'].'" alt="'.$article['photo']['title'].'" class="gallery_image"/>';
                                        echo '</a>';
                                }

                                        echo '<br /><a href="'.$link.'">'.$article['title'].'</a>';
                        echo '</td>';
                        $i++;
                if($i == 4){
                        echo '</tr>';
                        $i = 0;
                }
        }
        if($i != 4){
                echo '</tr>';
                $i = 0;
        }
        echo '</table>';
?>
</div>