Black hole shadow in an expanding universe with a cosmological constant