added imgrex, some optimisation