If else statement not working

I am using Meta Box Plugin

I have two options in Post Edit. One to add a Logo and one to add a Title. On the front end (in my template) I want to show either the Logo or the Title, but not both.
I added this code to my template however it is not working:

Read More
<?php if( rwmb_meta('restauranttheme_hero_small_logo', false, 'url') !== '' ) { ?>
    <?php $images = rwmb_meta( 'restauranttheme_hero_small_logo', 'type=image_advanced&size=full' );
        foreach ( $images as $image ) {
            echo "<img src='{$image['url']}'>"; } ?>
   <?php } else { ?>
            <h1 class="mini-title"><?php echo rwmb_meta('restauranttheme_hero_title' ); ?></h1>
   <?php }  ?>

I also tried:

<?php if( '' != rwmb_meta('restauranttheme_hero_small_logo' ) ) { ?>
    <?php $images = rwmb_meta( 'restauranttheme_hero_small_logo', 'type=image_advanced&size=full' );
        foreach ( $images as $image ) {
            echo "<img src='{$image['url']}'>"; } ?>
    <?php } else { ?>
           <h1 class="mini-logo"><?php echo rwmb_meta('restauranttheme_hero_title' ); ?></h1>
    <?php } ?>

I guess the error is in my if else statement.
Can anyone help?

Thanks so much

Related posts