Import v20141109, Support PBM image format, Cherry-picked 2c583829