reorganising pics into object array