This fixes the problem where it wouldn't properly add images for bug #8138.