Fixed a bug I jsut introduced in the units calculations. Testing confirms functionality.
Merge pull request #15 from sstupka/master

Fixed oversized images in database