added function to detect card in image