I just came across this need the other day. The secret was to look at the
documentation concerning the -resize option, which led me to the details about the
image geometry settings.
If the original images already have the aspect ratio you want, then just set both numbers to the maximum value you want: "-resize 800x800". By default it will preserve the aspect ratio while shrinking or enlarging until the larger dimension equals the set value.