openfimg: Various fixes

Fixes of issues found while experimenting with shaders.

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