Resizing xml gallery

i followed the xml gallery tutorial in kirupa and got the xml gallery working
but i want to ask couple of things

  1. if the images are of diff size how can we resize the container according to the image size

  2. if i have diff set of images in diff folders how can i access them in diff sets
    like if there r pictures of wedding in one, holidays in another how can i display the folders in the scroll, then when clicked load the pictures of that particular folder set

cud anyone plz help