Fix size for width and height as default
Add check for max-width and max-height

TODO: refactoring