Properly handle scaling on different devices