Pulled out image logic and added auto refresh