Applied maxWidth and maxHeight to the initialWidth and initialHeight.  Fixes #391