Safe (but inelegant) deletion of files

Folders have been deleted since long, now the script allows for the
deletion of folders where each image has a mean smaller than X (mostly
only noise in the images), the difference between the darkest and
brightest image of the stack are X (not enough gray values) and for the
deletion of single images which are darker than the second-darkest image
+ X percent, thus probably mostly noise.
I wanted to do this deletion with a nice list comprehension, but
couldn't get it to work, now deleting files in a for-loop...
Additionally, a bit more meaningful plots, including maximum and
deletion criterion and more original images in the right side of the
plot.