Also this part:
Code:
Imagine["TestFrame"..i] = CreateFrame("Frame",Imagine["TestFrame"..i],UIParent)
...performs a table lookup, finds no value (because the frame hasn't been created and assigned to that key in that table yet, and even if it had been, a table is not a valid value for use as a frame name) and results in passing
nil to CreateFrame, so you should just do that directly:
Code:
Imagine["TestFrame"..i] = CreateFrame("Frame",nil,UIParent)