Extracting multiple photos from a single quickly
You could use ImageMagick or NetPbm tools to crop the photos from a script, but it isn't going to automatically detect the rectangle edges.

Lay out your photos in roughly the same place every time you scan them. Leaving a small gap between the photos would give you a safety buffer; the resulting scanned/cropped photos will just have a white border around them.