[merge] introducing Img and PGM class