Fixed problem with pushing to head instead of tail, fixed for images where levels*2 > height