(#591): Check for size overflow before creating images for the public API
Fixes #591 (closed).
Now all the image sizes are kept as f64
for as long as possible, until a final check for overflow at the end converts them to ints for creating image surfaces or pixbufs.