How to create image gallery with CodeStar Metabox?

1.Creating Gallery field:

// a field
array(
   'id'          => 'gallery_2',
   'type'        => 'gallery',
   'title'       => 'Logos of the happy clients',
   'add_title'   => 'Add Images',
   'edit_title'  => 'Edit Images',
   'clear_title' => 'Remove Images',
),

2. Showing the gallery on frontend:

$meta_data = get_post_meta( get_the_ID(), 'section_testimonial', true );
$gallery   = $meta_data['gallery_2'];
if ( ! empty( $gallery ) ) {
   $ids = explode( ',', $gallery );
   foreach ( $ids as $id ) {
      $attachment = wp_get_attachment_image_src( $id, 'full' );
      ?>
      <li data-sr='enter top, wait 0.2s'><img src="<?php echo $attachment[0]; ?>"
                                              alt=""></li>
 
   <?php }
 
}