App is runnable, but the picture organizing algorithm is broken