Is this for the OP's own toons or the toons of others he plays with on his server?
I could be misunderstanding the OP, but if his trouble is that some of his own toons are getting the generic portrait and he wants to know what the filenames are so that he can reinstall them (which may well be a giant pain in its own right), then logging in an saving his toons locally will allow them to be read using Leto. Alternatively, one could easily write a letoscript script that printed out the portrait file names of all of the characters a player has in his localvault, assuming one has moneo installed.
But, the problem may be that he isn't seeing the portraits for other toons on the server on which he plays, which is a common issue and many servers have lists of portrait packs that they recommend to players as sort of a "server standard". To find out what the other players' toons' portrait files are, then a server-side script has to be available. I actually wrote something like this up a while ago (e.g. a tag-based script that would report to the PC the portrait file names of all of the PCs in his party), but I kind of lost interest in it and it would require that the server make a utility item available.