modify get image function to index page