Add support for max height and width parameters