Recently I had to locate the widest image in the set of photos in a directory. Here is how you can easily do it with identify command, from ImageMagick suit:

% identify -format '%w %f\n' * | sort -rn | head -n1
563 2010.12.30.JPG

You can see in the output that the widest image is 563 pixels wide and the filename is 2010.12.30.JPG.