On the interplay between Galois representations and endomorphism algebras of abelian varieties