You might be able to do this by calling wp_reset_postdata();
otherwise you will need to get the blog page ID and set that on the line before instead:
if ( is_home() ) {$post_id = get_option( 'page_for_posts' );} else {$post_id = $post->ID;}
$backgroundImg = wp_get_attachment_image_src( get_post_thumbnail_id($post_id), 'header-large' ); ?>
Note the is_home()
is actually used for the blog page, as distinct from is_front_page()
which is actually for the “homepage”.