Gimp is provided wwith various filters, including sharpening and adding a border.
Filters: Enhance: Add border.
The default is blue and wide, I don’t know why.
Set the options to, if you are me, 1 pixel wide, and click the colour to select from the usual colour diagram. White in this case. These settings persist for the session if not altered. I leave it on 25% opacity.
Click the button and it is made so.
Go back to Filters: and show the border ond again. Choose black, or use the dropper in that dialogue to pick a dark colour from the image. Probably nobody would notice.
You now have 3 layers, the top two are the borders, the one below is your image.
Having shrunk the image, you may wish to sharpen all or some of it for the final size. Do so in the usual ways.
Then merge or flatten the whole lot, and export it.