When you add images to your online Media Library, they automatically get processed to create additional image sizes – thumbnail, medium and large. Thumbnails are cropped (typically square) so they look consistent. The medium and large sizes are left at their original aspect ratio. The original uploaded image is also kept in your image library.
Standard gallery defaults are columns set to 3 and image size set to thumbnails. You can change set the columns to any number and the gallery will be scaled to fit the page area. You can set image size to display thumbnail, medium, or large.
Note that thumbnails are cropped to a fixed aspect ratio, typically square, so your gallery shows all images nicely aligned. Setting the gallery image to medium or large will show each gallery image at its own aspect ratio (landscape or portrait, etc.). Once you click on the gallery image, it will always show the enlargement uncropped.