Added option to use publicUrl over url.