Handle nulls and empty urls in bimg