OK, I would tend to agree with what you say, if you only have one component. It's an interesting problem.
Just to summarize, you are absolutely certain the extra space is not part of the JPanel, but part of the content pane? Pack is suppose to deal with this. I thought.
The problem as you describe it should not be related to the fact you have an image on the JPanel. Because you have programatically set the preferred Dimension of the JPanel to the size of the image. Do you agree? So It should happen with any old JPanel, or not at all. This provides a direction for your detective work.
In border layout, NORTH, SOUTH, EAST, WEST take as much space as they can/need. CENTER tends to take what is left. So if you have more than one compponent, and your fram is not big enough, what is in Center will lose out, and it is center that will show extra space if any if the other four are taller/wider.
Have you tried BorderLayout.NORTH or SOUTH? I'm guessing now.
You may find this course on Layout useful, it's not part of the
Java Tutorial
http://java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/shortcourse.html
If you solve it, let us know.