Working read/save image in luajit