Fix aliasing violations, optimize

Fix some violations of aliasing rules and optimize the code while at it:
There's no reason to use size_t/ssize_t (typically 64-bit values) for
the size of objects in pixels.

author	Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>