Pick up head images properly.
Correctly set repeat count on undo.

Fixes #301.