Last night I restringed my guitar which still had the shop-strings on it, it was the second time I've restringed a guitar. I just can't get multiple windings at the tuning pegs. Picture:

On the right side the D string as it came from the shop, on the left side my attempt at the G string... It has a little loop outside the peg.

I left the strings some slack as I've read, but everytime the windings would pop over the peg because there wasn't enough tension. So now all the strings have one winding at the peg. What am I doing wrong, how do you get multiple windings like on the picture?
Ibanez SA260
Roland Microcube
pinch the strings around the nut area and put pull some tension on it whilst winding them on and push down a bit, that should help stop the loops popping out above one another, and make sure theres a fair bit of lengh so u get enough loops