improved screen resolution detection