ensuring thread safety for cached image loads