Manually return false for function_exists

Have your function return your HTML rather than echo it. Perform the logic in the function to see if the image/logo are present and only return the HTML if that’s the case, otherwise returning null/false.

function my_header_function( $output = false ) {
     if ( /*image and logo have been uploaded */ ) {
          $output = /* HTML of your hero header */;
     }
     return $output;
}

Add a check to your hook function to see if your function returns content; if it does, echo it.

if ( function_exists( 'my_header_function' ) && ( $hero = my_header_function() ) ) {
     echo $hero;
}