Uncertainty in latent representations of variational autoencoders optimized for visual tasks