Hi, I am looking to make a slideshow a little different from what has been posted

I have only a foward and back button, but i wish to have a constant changing frame for all the jpg’s that can change depending on the size of each picture. I can’t seem to be able to get the width and height of each image to change the frame. (the frame would be just a simple 1 pixel wide line around the image). dynamic resizing of the frame before each pic loads would be really sweet. I would really appreciate any help. Thanks!