Create a shortcode to use in visual editor

Simple, make a shortcode:

function my_image() {

        $image = get_field('imagen_superior');
        if( !empty($image) ) {

                echo '<img src="' . $image['url'] . '" alt="' . $image['alt'] . '" />';

        }

}

function my_shortcode( $attr ) {

                return '<div class="header-image">' . my_image() . '</div>';    

}

add_shortcode( 'my-shortcode', 'my_shortcode' );

and then place [my-shortcode] in the visual composer.