Thank you. This is indeed the solution that I have used now. It is not fully robust because in my case there are several users-editors that can edit the website, and some users will probably upload larger images in the future for a page/post that should not use the header image. A per-post/page option would have been much easier, but the workaround is working for now.