Image Classification using LSTM

I have 40+ classes and I am trying to classify them using LSTM. Can someone help me out for deciding sequence_length, hidden_size? I also want to understand what are the factors that lead to deciding those values.
Thank You in advance.

Regards