Ich hab das vor deinem Modul via Template gemacht und mittels PHP random "dynamisch" 3 Klassen zugewiesen und zeitgleich entsprechende Bildgrößen erzeugt. Auf diesem Wege dürfte das mit den Klassen pro Bild eigentlich kein Problem sein.
	PHP-Code:
	
<?php foreach ($this->body as $class=>$row): ?>
    <?php foreach ($row as $col): ?>
    
    <?php if (!$col->addImage): ?>
    
    <?php else: ?>  
      
      <?php
        $rdm = rand(0,2);
           
        #Püfung Hochkant- Querformat
        if($col->width > $col->height)
        {        
            #print "Querformat";
            $breite = array(220, 440, 660);
            $hoehe = array(220, 320, 440);    
            
            $class = "q".$rdm;            
        }else{
            #print "Hochformat";
            $breite = array(210, 320, 440);            
            $hoehe = array(210, 440, 660);
            
            $class = "h".$rdm;    
        }
        
        #var_dump( $col);
    
        
        $strReturn = $this->generateImage($this->getImage($col->src, $breite[$rdm], $hoehe[$rdm], 'center_top'), $col->alt);
        // nun den Wert an ein Template übergeben.
        $this->Template->myFirstImage = $strReturn;
    
      ?>
      
      <figure class="image_container <?php echo $class; ?>"<?php if ($col->margin): ?> style="<?php echo $col->margin; ?>"<?php endif; ?>>
    <?php if ($col->href): ?>
        <a href="<?php echo $col->href; ?>"<?php echo $col->attributes; ?>  title="<?php echo $col->alt; ?>">
    
           <?php  echo $this->Template->myFirstImage; ?>
    
            
            </a>
    <?php else: ?>
        <?php  echo $this->Template->myFirstImage; ?>
    <?php endif; ?>
    
      </figure>
      
    <?php endif; ?>
    <?php endforeach; ?>
<?php endforeach; ?>
 Also quasi
	PHP-Code:
	
<?php
    $rdm = rand(0,2);
    $masonry_class = "klasse_".$rdm;
?>
 
	Code:
	<figure class="image_container <?php echo $masonry_class; ?>"<?php if ($col->margin): ?> style="<?php echo $col->margin; ?>"<?php endif; ?>>