Fix performance issue whereby cached images were recreated even when the original images was not changed