I think you can do something with a symlink. See here for an example: Wrapping a script which implicitly expects a local file - #6 by astrov
If it is a python script you could do something like (no working code just an idea):
if os.path.splitext(galaxyinputfile)[1] == ".dat":
cwd = os.getcwd()
jpginputFile=cwd+os.path.splitext(os.path.basename(galaxyinputfile))[0]+".jpg"
shutil.copy(galaxyinputfile, jpginputFile)
There may be better ways but this could give some inspiration already