Improved CPU use of animated image sources, fixed some memory management issues too.