On the Security of a Class of Diffusion Mechanisms for Image Encryption