modify implementation of dealing overlap image