add code for image reading