I use a custom portrait, and only have it configured in the player portrait file so it is not available anywhere else. You can easily do the same by removing the reference to your preferred portrait from everywhere but the player file.
Portrait files are added (or removed, as the case may be) to the .faction files in <install directory>\starsector-core\data\world\factions. You will need to add the file path to your portrait file to the "player.faction", under the section "portraits":{ or remove the same from all the other faction files to prevent them from using it. Order does not matter, just make sure the right path is in the list. By default portraits are kept in the <install directory>\starsector-core\graphics\portraits directory, so if you are doing this all manually that is as good a place as any to stick custom images. There is probably a more clean way to do it with proper modding tools, but that is beyond my current skill set. Maybe someone else can respond with a method that does not involve editing core game files.
I have never attempted this with other resolutions or file formats, and I have no idea what the game would do with an image files that is different in those ways, so I just make sure every portrait file I add is a 128x128 .png file.
I am not sure preventing the game from using the player portrait is the best over all solution, because quite a few of the portraits are space suites, and you would expect to find other people wearing the exact same thing flying around. Trying to add all kinds of rules for which ones can and cannot be duplicated would add a lot of complexity without giving much actual utility for the average player. People who find this kind of thing to be an issue can easily modify their files so it is no longer a problem.