fixed bug that causes crash when selecting a picture from library