openfimg: More control flow

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>