Image optimization and compression API