Handling animated images with orientation