Cleaner boundary wrapping function based on border copies