Fix --geometry producing wrong results
Fix number rounding, clarify comment and change var. names
Initial work on using FreeImage