fixed invalid photo crash