Fixed stdin issues, added shell commands to view images being sorted, added sorting code