Peano scanning of arbitrary size images