I have managed to solve this problem, but had to make some changes.
Second picture, which used to be white mask - have to be changed to be consisted of pixels that are in color that don't exist on source picture. So, I have change the mask picture - white pixels are changed to HotPink pixels...