fixed to take in account padded pixels
Authored by: rmottola 2014-11-29
Parent: [r415]
Child: [r417]