Added frame animation and image loading code