Maxfilenumber function
Different function for Minimum area calculation
main code modified

1. filename issue solved
2. auto selection dialogbox
3. minarea applied in auto selection