Not sure if this is what you're looking for, but here is a exhaustive search for all gauge invariant objects in electromagnetism:
Say $f[A_{\mu},\partial_{\mu} A_{\nu},\partial_{\mu}\partial_{\nu} A_{\rho},...]$ is a gauge invariant object. Here $f$ could itself have indices which have been suppressed. Under a gauge transform:
$$A'_{\mu}(x)=A_{\mu}(x)+\partial_{\mu}\theta$$
Gauge invariance means that:
$$f[A'_{\mu},\partial_{\mu} A'_{\nu},\partial_{\mu}\partial_{\nu} A'_{\rho},...]=f[A_{\mu},\partial_{\mu} A_{\nu},\partial_{\mu}\partial_{\nu} A_{\rho},...]$$
One can of course expand the left hand side to first order in $\theta$
$$f[A'_{\mu},\partial_{\mu} A'_{\nu},\partial_{\mu}\partial_{\nu} A'_{\rho},...]=f[A_{\mu},\partial_{\mu} A_{\nu},\partial_{\mu}\partial_{\nu} A_{\rho},...]+\frac{\delta f}{\delta A_{\mu}}\partial_\mu\theta+\frac{\delta f}{\delta \partial _\mu A_{\nu}}\partial_\mu\partial_\nu \theta+\frac{\delta f}{\delta \partial _\mu \partial _\nu A_{\rho}}\partial_\mu\partial_\nu\partial_\rho\theta+....$$
Since $\theta$ is an arbitrary function of $x$, each of the offending terms should separately vanish.
$$\frac{\delta f}{\delta A_{\mu}}=0$$
For the next term:
$$\frac{\delta f}{\delta \partial _\mu A_{\nu}}\partial_\mu\partial_\nu \theta=0$$
This means $\frac{\delta f}{\delta \partial _\mu A_{\nu}}$ is antisymmetric in $\mu, \nu$. i.e. $f=f[F_{\mu,\nu},....]$
For the next term,
$$\frac{\delta f}{\delta \partial _\mu \partial _\nu A_{\rho}}\partial_\mu\partial_\nu\partial_\rho\theta=0$$
This means $\frac{\delta f}{\delta \partial _\mu \partial _\nu A_{\rho}}$ is antisymmetric in $\nu, \rho$(it can't be antisymmetric in any other pair of indices). i.e. $f=f[F_{\mu,\nu},\partial_{\rho}F_{\mu \nu}....]$
So to first order in the gauge parameter, $f$ must be a function of the field strength and its derivatives. Since we know that these quantities are gauge invariant to all orders in the gauge parameter, this is an exact result.
So the upshot is: any function of $F_{\mu \nu}$ and its derivatives is gauge invariant. This is the only way to form a gauge invariant object.
A sensible quantum theory requires we exclude higher derivatives of $F_{\mu \nu}$ and exclude higher powers of $F_{\mu \nu}$(higher than 2). Poincare invariance requires us to soak up all the indices, therefore requiring at least two powers of $F_{\mu \nu}$.
This leaves us with only two terms in the Lagrangian:
$$\mathcal{L} = c_1F_{\mu \nu}F^{\mu \nu}+c_2 \epsilon_{\mu \nu \rho \sigma}F^{\mu \nu}F^{\rho \sigma}$$