Using CI's directory helper rather than scandir() faster and producses fewer errors