Adding class to last list item? Not WP generated

I can only see achieving this by first building an array, then looping over it – I can’t find anything in APC’s docs about checking if it’s the last iteration of the_repeater_field:

$images = array();
while ( the_repeater_field( 'homepage_service' ) )
    $images[] = get_sub_field( 'service_image' );

if ( $images ) {
    $image_last = array_pop( $images );

    echo '<ul id="servicelist" class="clearfix">';
    if ( $images )  
        echo '<li>' . implode( '</li><li>', $images ) . '</li>';
    echo '<li class="last-child">' . $image_last . '</li>';
    echo '</ul>';
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)