DRYed up pixel creation