Topic: Allowing an external image to fully download before continuing flow

Can anyone offer me some advice?

I'm making a little rails ap, which will simply pull some pictures off flickr modify them with imagemagick and then display them in the ap. I'm posting here because the code i'm struggling with isn't to do with rails.

I believe that before the picture has finished downloading with open-uri, imagemagick begins altering it, and this seems to mess up the bottom few lines of the picture, replacing them with either grey or fuzy-ness. At least I believe this is the problem.

Does anyone know of a way to prevent flow of execution until the picture has fully downloaded? either with open-uri or anything else.

Hope this makes sense!
shout if not!