Only applying the logic when the new value is different from the old one will most likely cause regressions.  This has happened before and there is a KS test that will break as a result of this (not sure if it's directly tied to the image view though).  I believe the scenario was something like this:
You initialize a backgroundImage to 'image1.jpg'.  Then you set the backgroundGradient (which will change the background of the view).  Then you set the backgroungImage back to 'image1.jpg' again.  

With your change, the backgroundImage will not switch back appropriately.