I am using imagecreatefromjpeg on a shared host, so if the image is to big then imagecreatefromjpeg will give me an "out of memmory error" and terminate the script.
Is there anyway to catch the out of memmory error, and simply let imagecreatefromjpeg fail(Return false) instead of terminating the script?