Fragment styling for inline images based on ratio