optimize images of assigned pages using Ruby