Added size options and removed double genration of image