foreach query for repeating fields group


<?php $hpSlider = get_post_meta( $slider_id, 'aa_slides_group', true );
    foreach ( (array) $hpSlider as $slide ) {
    $img = $title = '';
    if ( isset( $slide['message'] ) )
    $title = esc_html( $slide['message'] );
                                    
    if ( isset( $slide['image_id'] ) ) {
    $img = wp_get_attachment_image( $slide['image_id'], 'share-pick', null, array(
    'class' => 'thumb img-responsive',
    ) );
} ?>