delete inserted image, and make it generate by code