added second and third level morphological processes to manipulate jpeg images