Cleanup texture copying code.