So that we can use it also for custom icons. Also, merge some icon size checks into the function itself.