Optimize memory usage for history of paint action. 

Inserting paint actions into middle or history not supported!
(segmentation fault)