Gotcha: it is enough to exploit Legendre's relation and the fact that $$ m=\lambda^*(7)^2$$ with $\lambda^*$ being the elliptic lambda function.