As you have use the following assignment inn function file
img = imresize(img, [224, 224]);
This way applies to grayscale image.
But in main script, you pass the color image
picture = imread('5.jpg');
%reading the function
[label] = classifier(picture);
Either pass gray image to the function or change the imresize statement in function file, which may applicable for color image. You can easily do that check here.
Hope it Helps!