Your image has an aspect ratio of 1.5. The long side of your image is 1.5x longer than the short side.
5x7 is a 1.4 aspect ratio (long side is only 1.4x longer than the short side) and that is why the sides are getting cut off.
If you want to keep the sides you'll have to crop the top and bottom of your image to leave 3142x2244 to have a 5X7.
If you want to keep the top and bottom but sacrifice the sides use it as is, it's already cropped.