In imagemagick, this line of code will take all of the JPEGs in the working directory and resize them to 800 px wide (assumes they are in landscape format - this option has several variants that will fit your needs) and adds a white border to the top and bottom that is 30 pixels tall. It outputs a JPEG with a 3-digit sequential filename with "out" appended to it in the directory "output" inside the working directory.
convert '*.jpg' -gamma 0.45455 -resize 800 -gamma 2.2 -bordercolor 'white' -border x30 ./output/%03dout.jpg
The gamma conversion to linear and back to sRGB gamma is for resizing - resizing performed on a linear image has fewer artifacts. You can add many more options to the command, like JPEG quality, conversion to another ICC profile, etc.
kirk