Separated out the refreshImage function for home page.