implemented functionality to select images