Implemented EZP-20787: fiximagesoutsidevardir improvements

See https://jira.ez.no/browse/EZP-20787.

Makes the update script support the use-case where both the setting AND the vardir were changed, but existing images references haven't been updated.