Fixed issue with functional keys being not properly handled in IE.
Merge branch 't/12321'
Checking whether object exists before calling method on it.
Added a TC: removing img at IE might cause an exception.