As of current edited version of the post, you call setInterval
at each change's end, adding a new "changer" with each new iterration. That means after first run, there's one of them ticking in memory, after 100 runs, 100 different changers change image 100 times every second, completely destroying performance and producing confusing results.
You only need to "prime" setInterval
once. Remove it from function and place it inside onload
instead of direct function call.