add maxwidth & maxheight as parameter