Adding validation to image attachment