In this work, we establish a link between the classification of ECM-friendly elliptic curves and Mazur’s program B, which consists in parameterizing all the families of elliptic curves with exceptional Galois image. Motivated by Barbulescu et al. [ANTS X–proceedings of the tenth algorithmic number theory symposium, Berkeley, CA, 2013], we say an elliptic curve is ECM-friendly if it does not have complex multiplication and if its Galois image is exceptional for some level. Building upon two recent works which treated the case of congruence subgroups of prime-power level which occur for infinitely many
j
j
-invariants, we prove that there are exactly 1525 families of rational elliptic curves with distinct Galois images which are cartesian products of subgroups of prime-power level. This makes a complete list of rational families of ECM-friendly elliptic curves with cartesian Galois images, out of which less than 23 were known in the literature. We furthermore refine a heuristic of Montgomery to compare these families and conclude that the best 4 families which can be put in
a
=
−
1
a=-1
twisted Edwards’ form are new.