Avoid repeating the logic for sanitizing/validating pixel positions
Merge pull request #171 from astrofrog/simplify-pixel-positions

Avoid repeating the logic for sanitizing/validating pixel positions