Build scripts changed to support FreeBSD. File size check
implemented for input files. Fixed error that caused data
corruption in the last few bytes of bannerless images of certain
sizes. Added and expanded code comments all around.