addded defaults to the functions
add assert that all images are of same size
some refactoring of task_3
added Docstrings