Fixed a crash occurring on some devices when taking a picture