Page size too big due to images

Responsive images are in WordPress core since 4.4

https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/

srcset and sizes are used to accomplish this.

If your theme doesn’t implement these properly you will have to modify theme files.

<?php
// Specifying width of 400 (px) and height of 200 (px).
$srcset = wp_get_attachment_image_srcset( get_custom_header()->attachment_id, array( 400, 200 ) );
?>
<img src="https://wordpress.stackexchange.com/questions/318150/<?php header_image(); ?>" srcset="https://wordpress.stackexchange.com/<?php echo esc_attr( $srcset ); ?>">

https://developer.wordpress.org/reference/functions/wp_get_attachment_image_srcset/