MDL-44967 upgrade: fixed theme removal when themes have been removed already