fix out of memory when select photo