Refine image handler