add matlab ordering
resize image