added image model, added users and posts per page logic