Hi,
Make sure that you are creating the button early in the page life cycle, may be in Page_Init or Page_Load. Because, the dynamically created buttons does not hold view state. that is why you have to create the controls every time on Page_Init or Page_Load. also because the event handling will occur after the page Init stage. So, create the Image button in Page_Init event also assign onclick delegate in page_Init event only. then try.
for more refer
this[
^]
Hope it helps.