Imaging of critical correlations in optical lattices and atomic traps