Dust and gas environment of the young embedded cluster IRAS 18511+0146