I think the easiest and fastest solution would be an internal URL rewrite.
domain.com/placeholder/<whatever>.jpg
to
domain.com/placeholder.jpg
RewriteEngine on
RewriteRule "^/placeholder/.+\.jpg$" "/placeholder.jpg" [PT]
Then you would just echo the page slug as the image name.
ie:
domain.com/placeholder/my-whatever-slug.jpg
Whether it's well invested time to set that up is for you to decide however ;)
Edit:
Just realized Directory and FallbackResource would be a better solution if talking Apache. Works out almost the same except your existing images and "dynamic placeholders" would exist in the same directory. Like the 404 solution suggested above but without 404 response codes.
__________________
|