make function to make image from filtered data