The issue here is that when building the model, you are specifying an input size that has to match the input that you are passing it. For an image of 224x224x3 pixels, once you flatten it for a matrix multiplication, the actual input size (dimension) is 150528 = 224x224x3.
You might want to be careful about how you reshape the input, as reshaping 224x224x3 into (50176x3) is very different from (1x150528). The first says “I have a batch of 50,176 color pixels that I want to treat separately” while the second says “I have a single image of 150528 features.”