Q:

How do I do a For loop without freezing the GUI? 

I would like to know how I could run the following loop in a way where it doesn't freeze the GUI, as the loop can take minutes to complete.  Thank you. 
For i = 0 To imageCount
         'code
Next

A:

The short answer is you run the loop on another thread.  The long answer is a whole book and a couple of semesters at university, because it entails resource access conflicts and various ways of addressing them such as locking and queueing. 
Since you appear to be using VB.NET I suggest you use the latest version of the .NET framework and take advantage of Async and Await, which you can learn about from MSDN. 
These keywords implement a very sophisticated canned solution that will allow you to achieve your goals in blissful ignorance of the nightmare behind them :)

Why experienced parallel coders would bother with async/await
Standout features of async/await are 

automatic temporary marshalling back to the UI thread as required 
scope of exception handlers (try/catch/finally) can span both setup and callback code
you write what is conceptually linear code with blocking calls on the UI thread, but because you declare calls that block using "await", the compiler rewrites your code as a state machine makes the preceding points true

Linear code with blocking calls is easy to write and easy to read.  So it's much better from a maintenance perspective.  But it provides an atrocious UX.  Async/await means you can have it both ways. 
All this is built on TPL; in a quite real sense it's nothing more than a compiler supported design pattern for TPL, which is why methods tagged as async are required to return a Task<>.  There's so much to love about this, and no technical downside that I've seen. 
My only concern is that it's all too good, so a whole generation will have no idea how tall the giants on whose shoulders they perch, just as most modern programmers have only dim awareness of the mechanics of stack frames in call stacks (the magic behind local variables).