fixes selecting images after pagination and "the end" text