fixed a bug on images selection process