Selecting from an array of element with jQuery selector

Selecting from an array of element with jQuery selector

I have the following array of elements (it's quite large so I'm posting a link to pastebin):  http://pastebin.com/bM3BvD2F

and want to select the name of the image with id=2:

   
  1.  alert($(allImages[id=currentID])[0].name);

  2. but I get the name of image with id=4 instead:

      
  1. $(allImages[id=2])jQuery.jQuery.fn.jQuery.init[1]
    1. 0Object
      1. allowBuyExclusivefalse
      2. allowedPrintSizeArray[2]
      3. basePrise"1000"
      4. collection"Природа"
      5. id4
      6. imageHuge"http://127.0.0.1:8000/media/pictures/huge_2.jpg"
      7. imageLarge"http://127.0.0.1:8000/media/pictures/large_2.jpg"
      8. imageNormal"http://127.0.0.1:8000/media/pictures/normal_2.jpg"
      9. imagePreview"http://127.0.0.1:8000/media/pictures/preview_2.jpg"
      10. imageSizeRatio"6х9"
      11. imageSmall"http://127.0.0.1:8000/media/pictures/small_2.jpg"
      12. imageThumbnail"http://127.0.0.1:8000/media/pictures/thumbnail_2.jpg"
      13. isPurchasabletrue
      14. name"Another pic"
      15. popularity0
      16. __proto__Object
    2. length1
    3. __proto__Object[0]
how can I fix this?