Checking for valid url when modifying image