Fix regression bug 'default size' change on alignment

* Corrected the condition that set default size only if the image
  wasn't smaller than the default.
* Added a couple of sanity check conditions for the OO.Compare
  condition

Bug: 62586
Bug: 62581
Change-Id: I4db996cec33ac9d53ef485b53568100e3912c4ae
Merge "Fix regression bug 'default size' change on alignment"