Imagemagick springs to mind. It's free and runs on every operating system of interest, including Windows and Linux. Here's the blurb:
ImageMagick® is a software suite to create, edit, compose, or convert
bitmap images. It can read and write images in a variety of formats
(over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD,
PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip,
mirror, rotate, distort, shear and transform images, adjust image
colors, apply various special effects, or draw text, lines, polygons,
ellipses and Bézier curves.
It's a command line tool and therefore eminiently scriptable - provided you can read the documentation. (It's too late at night for me to try. ;) )
EDIT: Aww, shucks. Here's an example command that will annotate AngryCat.jpg with the text Copy 1 in the top left corner, producing output AngryCat_Copy1.jpg:
convert AngryCat.jpg -annotate 90 "Copy 1" AngryCat_Copy1.jpg
Documentation for -annotate. To do this 50 times, you just need a script that will vary the annotation text Copy 1 through 1-50 and the output filename AngryCat_Copy1.jpg through 1-50. (If you tell us what platform you're on, i.e. Win XP, Win 7, Linux, OSX, we might be able to provide an actual batch script.)