I cannot point out the exact thing, but the most probable reason may be
You are running a procedure in another procedure
Block optimization can be done at some parts.
Also you are setting the images from url. This may be taking the time and so your app freezes, till all the images get set. If this is the problem, then I think you can try using this extension by @DevYB