Moved function definition out of loop
Code cleanup
Refactored hasComputedStyle, small performance improvements

No need to define hasComputedStyle globally.
Improved looping.
images[x]['isImage'] already assures that the given element in
rwdImageChangeSrc is an image element, so don't double check