Fix bug with self-casting with special images