add image creation code