Optimisations of the main data structure and functions

* Now Image record carry nrows and ncols as fields.
* Vectors are used always that it is possible.
* Some often lazy sequence generations were avoided.