Correct bugs in photo deletion and remove useless files.