added support for rotating input images and having mutiple classes