change getExtension() to work with older php versions.
I'm looking at you Scientific Linux..
improved index file name