Release animatedImage when window is nil.

This fix memory issue when UIViewController is unloaded, gif image data is still alive.