This isn’t exactly what you’re asking for, and it’s possible something more like what you’re asking for exists – and I’m pretty sure that’s all possible through scripting (to be able to build the same comp around a chosen source file) – but you might want to take a look at this script (True Comp Duplicator) ; https://aescripts.com/true-comp-duplicator/
This script allows you to duplicate a comp while also duplicating all the files included in the comp so that the new copy is truly independent from the original comp in terms of its dependencies. And it offers useful controls for how deep (in terms of precomping etc.) to make the files “true duplicates” I bought it a few years ago (suggested price $25) and it kind of revolutionized my workflow for creating in AE. Like many users probably do, I end up with comps with at least a few levels of precomps, and when a creation is at a point where there is more than one promising direction it could go in it’s really useful to be able to make a truly independent copy to “branch” it off on its own.
In your case once you had built the comp once with a specific image, you could do a True Duplicate with the script, and then replace the image in the dupe (option drag from the project window onto the original in the timeline or Replace Footage command in the comp window) and type in the new text… But I wouldn’t be surprised if there is already a script (or maybe even expression) that could use a file name as the Source Text param value for a text layer