When parts of an image are added, some parts do not? [closed]

Here I have made the head, body and legs separately from Photoshop. I want to add them from JavaScript and create different shapes(actions).

But when it works, the parts fall apart and add up. (Sometimes the head is lost, sometimes the legs are lost, sometimes the body and the head are both lost) Sometimes everything comes together correctly (head+body+leg).

enter image description here