Unidirectional magnetoresistance in magnetic thin films with non-uniform thickness