Simulating STEM images in micrometers-thick solid and liquid specimens