added error checking for image URL that is too long