Based on the request I suggest using the Variables feature inside photoshop. Menu->Images->Variables
Then just select the layer you want to change and assign a variable name and choose "pixel replacement" behavior.
Outside Photoshop, create a text file with the variable name in the first line and the file names in new lines for each.
Go to menu-->file-->import-->variable datasets and browse for your text file.
If you see your error message then everything is correct.
Go to menu-->file-->export-->datasets to files and voila!