Cycles in isogeny graphs and corresponding endomorphisms