eeprom: ee1004: Move selected page detection to a separate function