added error handling for a bad image url