The quick and dirty method consists in applying a threshold on your image for bright/dark detection, converting the binary output to polygon and using the convex hull or the extent rectangle of the largest polygon to mask (with convex hull) or clip (with extent rectangle) your photo. You don't need to worry about water bodies/shadows because they will be inside your largest polygon.
Alternatively, you can use template matching/feature detection algorithm to automatically detect the fiducial marks, then build your polygon based on these four points and buffer it depending on the image portion that you want to keep (borders are usually of poorer quality and redundant). Those are white circles with a cross, so even simple a correlation filter would find them, and you can look only "near" the corners to speed up the process (the only possible confusion are the digits of the photo number).