Resources are not always just filenames; the array_unique in getResource() should suffice.