First press Ctrl-a to select the entire image. Then go to the menu item Select > Shrink and shrink the selection by 1 or 2 pixels depending on how thick you want the border.