Well, as far as the toggling goes, you are sending lockIt() method an argument with value 1.
So long the value of i is 1, the image loaded will always be "locked.jpg"
You will need to come up with some logic through flags, maybe; that can detect whichever image is loaded, and change it to the alternate one.