Hi,
Autoencoder is used to reconstruct something that is the same size as your input.
If you just want to do classification, you should have a network that only outputs one value per class. You can see the mnist example for such a model if you want.