Size scale dependence of compressive instabilities in layered composites in the presence of stress gradients