Perhaps it's easier to just set the pixels you don't want in the second image to 0?
im = im2.copy()
im[im1 == im2] = 0
im = Image.fromarray(im)
seems to work for me (obviously, only with large artifacts, because I used your loaded JPGs)

It is also possible to do this without numpy:
from PIL import ImageChops
from PIL import Image
root = '/root/'
im1 = Image.open(root + '1.jpg')
im2 = Image.open(root + '2.jpg')
def nonzero(a):
return 0 if a < 10 else 255
mask = Image.eval(ImageChops.difference(im1, im2), nonzero).convert('1')
im = Image.composite(im2, Image.eval(im2, lambda x: 0), mask)