added all conditionals required for pixel replication