Montage

Tile images into a grid, automatically calculating the grid cell size from the largest image
montage *.jpg -geometry +0 +0 result.jpg

Resize and crop images to fill their grid cells before tiling
montage *.jpg -geometry +0+0 -resize 640x480 -gravity center -crop 640x480+0+0 result.jpg