Fixed check for redundant calls to setImage.