fixed: frame vertical inversion, RGBA->RGBX; some code cleaning