Nanobubbles and micropancakes: gaseous domains on immersed substrates