// In the view controller where you create the subviews
// (not sure from your question, but I think you are adding image views to a scroll view
UIView *view = [[UIView alloc] init];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(viewTapped:)];
[view addGestureRecognizer:tap];
- (void)imageViewTapped:(UITapGestureRecognizer *)gr {
UIImageView *theImageViewThatGotTapped = (UIImageView *)gr.view;
}