User images were not being cached properly because Moodle was sending a session cookie. I've turned this off now for user images.