Overloading the setDimensions method to accept an java.awt.Image as a parameter