Light trajectories and thermal shadows casted by black holes in a cavity