Why do you paint the image by yourself? If this is the only thing, then you could use a JLabel too. There you can set an image.
But anyway, in order to get the image painted correctly, you need to set a size and a preferred size of the panel, which you are using to display the image. You need to calculate this from the image size. I think, if you do this, then your panel will be larger.