Xml photogallery dimensions problems

Using xml photogallery tutorial

Trying to load pictures that are not the same dimensions as those used in the tutorial so they appear outside the frame…is there a way to constrain the dimensions of the pictures i upload so they will automatically fit into the tutorial frame rectangle?