There is a module that does this, called Header Image
https://support.pillwax.com/open-source/doku.php?id=joomla:header_imageBut I find an easy way to do this is to use a custom module, load up the image I want for a particular page and assign that module to that page.
you can then duplicate this process for how ever many images you want.
I guess this isn't really practical if you have hundreds of different images for different articles, but if you only have a dozen or so, it works really well!