I agree with Veena. Its better to move on to sightly rather than working on JSP's anymore.Sightly(HTL) separates out the back end logics to java or javascript use api and front end is just to read the properties, loop the properties and display it. It looks more clean and manageable.
As @riteshrajput suggested it should be available in OOB image component. If you need modifications you can copy it and modify it as per your needs or you can overlay.
Hi Sandhya,Does Country1 and state1,state2 have relation?Like if I select contry1 both state1, state2 should be selected or if I select state1,state2 country1 should be automatically selected something like that.