Topological Sort Using Decrease Jpg Dimensions