Added the ability to define also the sampling mode for the jpeg compression