fix npe after select from gallery