How to fix black border issue when I take photos?

I'm using a Nikon D5100 with 50mm f1.8 lens. The photos I take suddenly have this black border on the top side of all my photos. Also, this happens only every other time I take a picture.
Added (1). ---
I'm also shooting with JPEG Fine settings. The black border on top of my photos takes up about a fourth of the picture.

Hard to say for sure without having the camera in my hands, but my guess would be: You are probably shooting in RAW+Jpeg, and have set the jpeg image to 16:9 format or similar. It may be that if you view the images in a different program you would not see the black borders.