improve image callback