Both images in the following example were originally rectangular. The first is a jpg, and the second is a .png with a transparent alpha channel. Because these images have a different shape than the container, a margin of unused space appears at the top and bottom of each image. You have the option to save the extra space as part of the image, which effectively makes the image square, or to retain its original rectangular shape. You can see the result of this setting if you right-click to save an image from the Product View page.
Although both of these images were saved with the additional space at the top and bottom, only the .jpg appears to have solid white “borders.” The other image has the same space added, but is transparent.