making index file get images dynamically