Your HTML is probably generated dynamically by some server side scripting, such as PHP/Ruby/Python/ASP.NET, right? and I assume you’ve set the max-age there, with server side scripting?
Images, usually, are not served through server side scripting, so whatever your framework is setting for HTML, does not get applied there. Images are typically served directly by the web server (Nginx), and headers for them will be determined there. Look for “add_header Cache-Control” in your Nginx configuration file. Or just for the value 2592000. It’s highly likely you’ll find it there. If not, you can always add your own add_header and set whatever value you want there.
Another approach which is maybe better, is to dynamically invalidate the cache at clients. Since you’ve already invested in creating a dynamic cache period and your expectation is that images will follow the HTML refresh patterns, you could simply append a dynamic suffix querystring to the images URLs from within your HTML. That way, every time the HTML updates (evicted from browser caches), the browser will see a new URL for the image, even though it’s the same image absolute path, and will refetch it.
<img src="/images/icons/flags/gb.png?now=1550465082" />
(1550465082 is the current unix timestamp, e.g. the output of the time() function in PHP. by the way, don’t call getting time for each URL, it’s just a waste of resources and context switches. fetch the time once from the OS into a variable, and append the value of this variable to all images in your page)