refactored picture utility