automatic gif frame counting added