I’m far from knowledgeable about UE4 yet, but I’m a web developer and maybe I can help clarify some requirements.
Do you need it to run headless? (Without a window visible on some screen, somewhere?) Or can it pop up a window for a moment, make the image, and then close the window?
If so, then it’s probably not too hard to do what you want. I do wonder if it’ll be fast enough for what you want, though. Depending on what you’re doing, it might be a lot quicker to have an already-running instance of UE4 with the scene you want to re-render with changes, and just send it a message to make a new render. It’ll really depend on how detailed you’d want to get.
How I’d set it up in the first case:
Browser would contact the server and send info to a script server-side. The server-side script would either run something on the same box, or send a message to a remote box that would run UE4 with command-line parameters detailing what you want done, and where the output should go. After it finishes running, the image is returned to original server (if necessary) and then the server-side script would move it (if needed) and give the URL back to the app in the browser.
For the second case, there’d need to be some way to have the server-side script talk directly to the UE4 instance, but I’m pretty confident I could figure that out, too.
At any rate, I’m 99% certain it can be done because UE4’s source is available and it could be hacked in, if needed. I’m 90% certain no source code modifications would be necessary, though.