Jquery to display images andattachments
===

        i want to display images if its of .jpg or .png else  an image of pdf if its .pdf else an text file image if its extension is .txt. and i have all those details in a list and i am passing it from controller

the  display should be like grid ex below


   image1            image2             image3


   image4            image5             image6