The best tool for resizing images is ImageMagick. I prefer it as I can edit images in bulk and I like the simple interface.

For example (Linux; this will create a directory tmp in the current directory and (command 1) and the second command will resize all images in the current directory to a size where the longer side (landscape or portrait) is exactly 500 pixels):

mkdir tmp
for i in `ls *.JPG`; do name=$(echo $i | cut -d. -f1); convert $i -resize 500x500 tmp/$name.jpg; done


Docs:

https://www.imagemagick.org/Usage/resize/#resize