Use more better way to set image os type