tidy up imageanimator code