FPDF: Image size issue

I am updating the cover page of the PDF with an image using FPDF and FPDI. I want to fit that image in a cell of specified width and height without giving image dimensions. So, the issue is when the image dimensions are more than cell dimensions , it used to go out of the cell. How can i fit that image in a cell without giving image dimensions? Can i resize it?