Extracted listener to its own class. Cleaned up. Added logic

Added setFlagOnPicture in the getCells()