Javascript cleanup, tried some new hacks to make images flash less, not sure if it worked.