added a delegate to select the images