Efficient and Autonomous Processing and Classification of Images on Small Spacecraft