Added check for a selected image when the user clicks the Done button