Fix random image code