Added return img and code