badge image sizing, clean up codes