jpg-load: Fix abort on computing without valid path/uri
png-load: Fix abort on computing without valid uri/path

Overeager error checking :)