omb_utils_get_image: close directory properly

Also remove some whitespaces..
Merge pull request #1 from athoik/fixclosedir

omb_utils_get_image: close directory properly