Hi Thomas,
I think the problem is where you put the code that gets the image. For the template that doesn't have header background, you should perform a simple check like this:
$images = rwmb_meta(...);
if ( $images ) {
$image = reset( $images );
echo $image;
}