Fixed bug on filtering which images to process