We can use the built-in sips command to resize all files in a folder while keeping the aspect ratio intact.
To resize all JPG files in the current folder, while maintaining aspect ratio and not letting either the height or width go above 1600 pixels, issue the following:
sips -Z 1600 *.jpg