implement ImgDirectiveParser