swapImage now resets the CSS classes of the elements after completing
the animations
functions for setting up grid images and updating them