Bug fix + optimization:

- A curve with the last keyframe whose right derivative is 0 was not
always drawn correctly
- Optimisation of the code in renderViewer so when an image is not
cached we do not call getRegionOfDefinition twice.