Modifying js code

Job ID: 31294785

Budget: $10 – $30 USD

I am having trouble modifying a js code, should be an easy task fro some one with experience.

The idea od the code is to generate unique images, based on layers (png format).

Let´s say we want to create a dog, the we can define 3 layers: head, body and legs. For each one of these categories there are different items:
head1, head2, head3
bodt1, body2, body3, body4, body5
lega1, legs2

So we can make a max of 30 images. We have a code for this but we are having some overlapping issues. Also we want to define algorithmically the rarity of some items (for instance that the head 2 only appears once)
Related categories: PHP JavaScript HTML jQuery / Prototype Node.js