getImageSize url = unsafePerformIO $ getImageSize' url
    where getImageSize' url = do let (name,fload) = getSimpleFunctionNameType url
                                 tmpDir <- retrieveTempDir
                                 let path = tmpDir </> name
                                 bool <- doesFileExist path
                                 if bool
                                  then do gdimg <- fload path
                                          (w,h) <- imageSize gdimg
                                          return (w,h)
                                  else return (50,50)   -- default (width, height), usually because the dowloading process of images is not completed
getImageSize url = unsafePerformIO $ getImageSize' url
    where getImageSize' url = do let (name,fload) = getSimpleFunctionNameType url
                                 tmpDir <- retrieveTempDir
                                 let path = tmpDir </> name
                                 bool <- doesFileExist path
                                 if bool
                                  then do gdimg <- fload path
                                          (w,h) <- imageSize gdimg
                                          return (w,h)
                                  else return (50,50)   -- default (width, height), usually because the dowloading process of images is not completed
getImageSize url = unsafePerformIO $ getImageSize' url
    where getImageSize' url = do let (name,fload) = getSimpleFunctionNameType url
                                 tmpDir <- retrieveTempDir
                                 let path = tmpDir </> name
                                 bool <- doesFileExist path
                                 if bool
                                  then do gdimg <- fload path
                                          (w,h) <- imageSize gdimg
                                          return (w,h)
                                  else return (50,50)   -- default (width, height), usually because the dowloading process of images is not completed