You need to use the toolbar to embed images. The linked file option doesn't work.
My guess, if the media player doesn't add a border to the images then it's twitter problem. If they show up you could have a bit of transparency on the edges which will render as black when compressed. You can check the edges in AE by setting the Magnification factor way up and carefully checking the edges. This could also be a pixel aspect ratio problem. The comp should be set to square pixels.
Nobody can know for sure unless we see detailed screenshots that show enough information so we can see the problem.
This happens when you see in full screen or directly in the Twitter thread? Because if it is in full screen it would be normal, because the current screens are practically all 16: 9 or some small variation. If your video is square it will be seen in Letterbox or Pillarbox.