init.php: handle glob() result carefully (#1273)

...otherwise it sends warnings out to FastCGI stderr and breaks images.