Only refresh images when the window has focus