The easiest way to make an image fit a ratio is to crop it in a graphics program, like Gimp, but if you want to take the picture within Second Life itself, this is the tutorial for you!
This guide is for taking these pictures in Firestorm, but the default browser likely has similar functionality.
In Firestorm, "Snapshot" can be viewed either large, as below, or small. The important part is to the left under DISK, though.
Up close, you can see that it is set to save to disk. Under that is a drop-down menu with a number of options, the bottom of which is "custom", which allows you to manually change the width and height. Then make sure the "constrain proportions" box is unclicked, as below, so that the numbers won't snap to the aspect ratio of your screen.
Finally, type in your numbers. If you find math challenging, using the Ratio Calculator at tutorvista.
Hope this helps!