Fixed a crash due to the use display.getSize() in older devices.