Automated and accurate classification of pathologies on endoscopic images is a current challenge for Gastroenterology. This paper presents an approach to assist medical diagnosis processes of diseases and anomalies in the gastrointestinal tract based on the classification of features extracted from endoscopic images with a convolutional neural network and transfer learning type fine-tuning. The proposed strategy was evaluated on real endoscopic images from the Kvasir dataset. Specifically, we used 8000 images from 8 classes showing anatomical landmarks, pathological findings, and endoscopic procedures in the gastrointestinal tract. The proposed method allows obtaining an accuracy classification of 94.6%, which is 2.1% more accurate than the best result in the literature under very similar conditions, and up to 13.6% more precise.