Use below code
<?php
$isFirst = true;
$i=1;
foreach ( $attachments as $attachment ):
$description = $attachment->post_content;
if($i==1)
{
echo '<div class="item'.$isFirst.'" data-description="' . $description . '">';
echo wp_get_attachment_image($attachment->ID, 'large');
echo '</div>';
}
else
{
echo '<div class="item" data-description="' . $description . '">';
echo wp_get_attachment_image($attachment->ID, 'large');
echo '</div>';
}
$i++;
endforeach;
?>