refactor image size feature (not extension dependent)