Background image in Masterpage

I have a hero component that has a background image with is populated by CSS. The hero is included in a master page. I want to keep the hero text on all pages, but I want the background image to be different on each page. Is there a way of doing this? I’m using version 4.4