funciton sort_imtrialsbyBdata added to sort image trials into mean(sampling period) of each trial type