Much shorter function here, does the same thing and pulls in the images from the original posts gallery:
global $sitepress;
$current_main_id = icl_object_id( get_the_id(), 'post', true, $sitepress->get_default_language() );
$images = get_field('gallery', $current_main_id);