Filtering out blank and mask images