A: 

You can do two for loops. This is just an example, not specifically applied to your code:

for( $i=0; $i<3; $i++ )
{
    echo "<div id=clientrotate$i>";
    // etc

    for( $k=0; $k<4; $k++ )
    {
        echo "<div class='thumb$k'>";
        echo "</div>";
    }
    echo "</div>";
}
hookedonwinter