Added support for custom page size