Every passport authority sets a head height range. The U.S. requires 1 to 1 3/8 inches on a 2 x 2 inch photo. Canada requires 31 to 36 mm on a 50 x 70 mm photo. Australia requires 32 to 36 mm.
A photo can have the right outer size and still be rejected because the head is too small or too large.