read images into int arrays