Fixed for PNG versions less than 1.5 and greater than 1.3