Cache images correctly in the background