>my form seems to take 5-10 seconds to be submitted and redirected to the thank you page :/
That does seem slow.
>Is there a way to restrict the gif animation to only show when the form has gone through?
The form hasn't 'gone through' until you are redirected to the success page. So what you are asking for doesn't really make sense.