omb_utils_get_image: close directory properly

Also remove some whitespaces..