Hints
Look upwards, grab the green pipe.
Click the bottom right of the screen, grab the match.
Turn right once, in the second sand bit you will find another match and a metal thing.
In the same screen click on the middle rail, use the metal thing on the loose nail and get it.
Turn right again and pick up the hammer.
From that screen go to the bottom right and pick up a green pipe.
View the metal piece in about items, then use the matches on it and they will light up.
Two corners of the box have a metal band around the bottom, use both your green things and the lit matches on them.
They should now pop off.
Now use the nail to on each of the grey tabs at the bottom of the cage.
Now click on the chain.
You have just escaped!