latest work
added index for performance
checking for existance of index and skipping if image exists